Retrospring/spec/features/users/follow_user_spec.rb

29 lines
751 B
Ruby
Raw Normal View History

2014-12-26 06:28:53 -08:00
include Warden::Test::Helpers
Warden.test_mode!
feature "User profile page", :devise do
after :each do
Warden.test_reset!
end
scenario "user gets followed", js: true do
2020-04-19 08:27:42 -07:00
me = FactoryBot.create(:user)
other = FactoryBot.create(:user)
2014-12-26 06:28:53 -08:00
login_as me, scope: :user
visit show_user_profile_path(other.screen_name)
page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true
click_button "Follow"
wait_for_ajax
page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true
expect(page).to have_text("FOLLOWING")
click_link 'Follower'
2014-12-26 06:28:53 -08:00
page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_3.png"), full: true
expect(page).to have_text(me.screen_name)
end
end