Skip to content
This repository was archived by the owner on Oct 3, 2018. It is now read-only.
This repository was archived by the owner on Oct 3, 2018. It is now read-only.

Inject login helper for Integration Tests #15

@bousquet

Description

@bousquet

Something like this needs to be added and auto-injected into the test suite:

class MiniTest::Rails::ActionDispatch::IntegrationTest

  # Public: Login helper for the thincloud-auth forms using Capybara.
  #
  # identity - Thincloud::Authentication identity object
  #
  # Returns the Capybara session after clicking the login button.
  def login(identity=nil)
    identity ||= create(:identity)

    visit login_path

    within("#login form:first-child") do
      fill_in "auth_key", with: identity.email
      fill_in "password", with: identity.password

      click_button "Login"
    end

    identity
  end

end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions