Remove popup on follow buttons and remove uneeded code.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-19 17:06:52 +02:00
parent cba497b32e
commit c9a6630c94
7 changed files with 16 additions and 78 deletions

View File

@@ -41,16 +41,15 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
expect(page).to have_link("Follow")
end
scenario "Should display unfollow button when click on follow button", :js do
scenario "Should display unfollow after user clicks on follow button", :js do
user = create(:user)
login_as(user)
visit send(followable_path, arguments)
within "##{dom_id(followable)}" do
click_link "Follow"
page.find("#follow-#{followable_dom_name}-#{followable.id}").click
expect(page).to have_css("#unfollow-expand-#{followable_dom_name}-#{followable.id}")
expect(page).to have_link "Unfollow"
end
end
@@ -64,7 +63,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
expect(page).to have_link("Unfollow")
end
scenario "Should display follow button when click on unfollow button", :js do
scenario "Should display follow button after user clicks on unfollow button", :js do
user = create(:user)
follow = create(:follow, user: user, followable: followable)
login_as(user)
@@ -72,9 +71,8 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments)
within "##{dom_id(followable)}" do
click_link "Unfollow"
page.find("#unfollow-#{followable_dom_name}-#{followable.id}").click
expect(page).to have_css("#follow-expand-#{followable_dom_name}-#{followable.id}")
expect(page).to have_link "Follow"
end
end