Files
grecia/spec/system/sessions_spec.rb
Javi Martín 9427f01442 Use system specs instead of feature specs
We get rid of database cleaner, and JavaScript tests are faster because
between tests we now rollback transactions instead of truncating the
database.
2020-04-24 15:43:54 +02:00

21 lines
554 B
Ruby

require "rails_helper"
describe "Sessions" do
scenario "Staying in the same page after doing login/logout" do
user = create(:user, sign_in_count: 10)
debate = create(:debate)
visit debate_path(debate)
login_through_form_as(user)
expect(page).to have_content("You have been signed in successfully")
expect(page).to have_current_path(debate_path(debate))
click_link "Sign out"
expect(page).to have_content("You have been signed out successfully")
expect(page).to have_current_path(debate_path(debate))
end
end