Sha256: c292a4af3d617e1b83e5fe2f6dff806a6992bea10169a86ce1ada8c09c4d47ad

Contents?: true

Size: 905 Bytes

Versions: 14

Compression:

Stored size: 905 Bytes

Contents

class ViewCase < ActionView::TestCase
  include Capybara::DSL
  include Capybara::Assertions
  include Rails.application.routes.url_helpers

  def teardown
    Capybara.reset_session!
    Capybara.current_driver = :poltergeist
  end

  private
    def login(password = 'foobar')
      fill_in 'inputEmail', with: adminpanel_users(:valid).email
      fill_in 'inputPassword', with: password #pass is foobar
      click_button I18n.t('authentication.new-session')
    end

    def login_user_with_role(role)
      fill_in 'inputEmail', with: adminpanel_users(role).email
      fill_in 'inputPassword', with: 'foobar' #pass is foobar
      click_button I18n.t('authentication.new-session')
    end

    def submit_modal(button)
      click_button button #the modal submit is a button actually, not a link
      sleep 0.5
    end

    def trigger_modal(link)
      click_link link
      sleep 0.5
    end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adminpanel-2.6.1 test/support/view_case.rb
adminpanel-2.6.0 test/support/view_case.rb
adminpanel-2.5.5 test/support/view_case.rb
adminpanel-2.5.4 test/support/view_case.rb
adminpanel-2.5.3 test/support/view_case.rb
adminpanel-2.5.2 test/support/view_case.rb
adminpanel-2.5.1 test/support/view_case.rb
adminpanel-2.5.0 test/support/view_case.rb
adminpanel-2.4.3 test/support/view_case.rb
adminpanel-2.4.2 test/support/view_case.rb
adminpanel-2.4.1 test/support/view_case.rb
adminpanel-2.4.0 test/support/view_case.rb
adminpanel-2.3.1 test/support/view_case.rb
adminpanel-2.3.0 test/support/view_case.rb