Sha256: ba0a239e2bdcb5fd16ea6982113c09138e9d4850251ff4512e137443b4c51b66

Contents?: true

Size: 1.67 KB

Versions: 15

Compression:

Stored size: 1.67 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper' ))

module IntegrationTests
  class UserLoginTest < ActionController::IntegrationTest
    def setup
      super
      @site = use_site! 'site with pages'
    end
  
    test "A verified user logs in with valid credentials" do
      visit '/login'

      fill_in 'user_email', :with => 'a-user@example.com'
      fill_in 'user_password', :with => 'a password'
      click_button 'login'

      controller.current_user.should_not be_nil
      controller.current_user.email.should == 'a-user@example.com'
    end
  
    test "A verified user logs in with invalid credentials" do
      visit '/login'
      fill_in 'user_email', :with => 'a-user@example.com'
      fill_in 'user_password', :with => 'a wrong password'
      click_button 'login'

      controller.current_user.should be_nil
      renders_template 'session/new'
    end
      
    test "An unverified user logs in with valid credentials" do
      visit '/login'
      fill_in 'user_email', :with => 'an-unverified-user@example.com'
      fill_in 'user_password', :with => 'a password'
      click_button 'login'

      # FIXME we don't provide any more specific feedback?
      controller.current_user.should be_nil
      renders_template 'session/new'
    end
      
    test "An unverified user logs in with invalid credentials" do
      visit '/login'
      fill_in 'user_email', :with => 'an-unverified-user@example.com'
      fill_in 'user_password', :with => 'a wrong password'
      click_button 'login'

      # FIXME we don't provide any more specific feedback?
      controller.current_user.should be_nil
      renders_template 'session/new'
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
adva-0.3.2 test/integration/user_login_test.rb
adva-0.3.1 test/integration/user_login_test.rb
adva-0.3.0 test/integration/user_login_test.rb
adva-0.2.4 test/integration/user_login_test.rb
adva-0.2.3 test/integration/user_login_test.rb
adva-0.2.2 test/integration/user_login_test.rb
adva-0.2.1 test/integration/user_login_test.rb
adva-0.2.0 test/integration/user_login_test.rb
adva-0.1.4 test/integration/user_login_test.rb
adva-0.1.3 test/integration/user_login_test.rb
adva-0.1.2 test/integration/user_login_test.rb
adva-0.1.1 test/integration/user_login_test.rb
adva-0.1.0 test/integration/user_login_test.rb
adva_user-0.0.1 test/integration/user_login_test.rb
adva-0.0.1 adva_user/test/integration/user_login_test.rb