Sha256: 21b42908ed5fb144ddf50fc810c57bd9b7e6e409c4a0bc0ccd0dc415b5840357

Contents?: true

Size: 616 Bytes

Versions: 9

Compression:

Stored size: 616 Bytes

Contents

require 'test_helper'
require 'capybara/rails'

module ActionController
  class IntegrationTest
    include Capybara::DSL

    def login(role = nil)
      logout
      user(role)
      visit new_user_session_path(:lang => :de)
      fill_in "E-Mail", :with => user.email
      fill_in "Passwort", :with => user.password
      click_button "Anmelden"
    end

    def logout
      visit dashboard_path(:lang => :de)
      click_link_or_button "Abmelden" if page.has_link?("Abmelden")
    end

    def user(role = nil)
      @user ||= FactoryGirl.create(:user, :role => (role || User.default_role))
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iqvoc_skosxl-2.1.0 test/integration_test_helper.rb
iqvoc_skosxl-2.0.2 test/integration_test_helper.rb
iqvoc_skosxl-2.0.1 test/integration_test_helper.rb
iqvoc_skosxl-2.0.0 test/integration_test_helper.rb
iqvoc_skosxl-1.2.3 test/integration_test_helper.rb
iqvoc_skosxl-1.2.2 test/integration_test_helper.rb
iqvoc_skosxl-1.2.1 test/integration_test_helper.rb
iqvoc_skosxl-1.2.0 test/integration_test_helper.rb
iqvoc_skosxl-1.1.4 test/integration_test_helper.rb