Sha256: ee01c505043d57f39c281109ab722cd46d277b51b56180c085fee463718f4e4c

Contents?: true

Size: 598 Bytes

Versions: 5

Compression:

Stored size: 598 Bytes

Contents

require 'test_helper'

class SignInTest < ActiveSupport::IntegrationCase

  teardown do
    Capybara.reset_sessions!
  end

  test 'failed sign in' do
    sign_in_as 'bob', 'secret'

    assert_equal sign_in_path, current_path
    within '.flash.alert' do
      assert page.has_content?('Sorry, we did not recognise you.')
    end
  end

  test 'successful sign in' do
    user_factory 'Bob', 'bob', 'secret'
    sign_in_as 'bob', 'secret'

    assert_equal root_path, current_path
    within '.flash.notice' do
      assert page.has_content?('You have successfully signed in.')
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
quo_vadis-1.0.4 test/integration/sign_in_test.rb
quo_vadis-1.0.3 test/integration/sign_in_test.rb
quo_vadis-1.0.2 test/integration/sign_in_test.rb
quo_vadis-1.0.1 test/integration/sign_in_test.rb
quo_vadis-1.0.0 test/integration/sign_in_test.rb