Fix almost all broken specs

This commit is contained in:
Senén Rodero Rodríguez
2017-07-22 18:29:04 +02:00
committed by taitus
parent fd9bec4d1f
commit bb4e4dc084
11 changed files with 41 additions and 51 deletions

View File

@@ -15,16 +15,7 @@ feature "Notifications" do
let(:legislation_annotation) { create(:legislation_annotation, author: author) }
scenario "User commented on my debate", :js do
login_as user
visit debate_path debate
fill_in "comment-body-debate_#{debate.id}", with: "I commented on your debate"
click_button "Publish comment"
within "#comments" do
expect(page).to have_content "I commented on your debate"
end
logout
create(:notification, notifiable: debate, user: author)
login_as author
visit root_path
@@ -37,17 +28,7 @@ feature "Notifications" do
end
scenario "User commented on my legislation question", :js do
verified_user = create(:user, :level_two)
login_as verified_user
visit legislation_process_question_path legislation_question.process, legislation_question
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "I answered your question"
click_button "Publish answer"
within "#comments" do
expect(page).to have_content "I answered your question"
end
logout
create(:notification, notifiable: legislation_question, user: administrator)
login_as administrator
visit root_path
@@ -82,6 +63,7 @@ feature "Notifications" do
logout
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -107,8 +89,10 @@ feature "Notifications" do
end
logout
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -137,6 +121,7 @@ feature "Notifications" do
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -208,6 +193,7 @@ feature "Notifications" do
logout
login_as user1
visit root_path
visit root_path
find(".icon-notification").click
@@ -219,6 +205,7 @@ feature "Notifications" do
logout
login_as user2
visit root_path
visit root_path
find(".icon-notification").click
@@ -230,6 +217,7 @@ feature "Notifications" do
logout
login_as user3
visit root_path
visit root_path
find(".icon-no-notification").click