Sha256: dd6c3ce88432caf580719ceb289fd63a768af30ffbcebf1c062e0bf561032b47

Contents?: true

Size: 934 Bytes

Versions: 2

Compression:

Stored size: 934 Bytes

Contents

# Feature: Sign in
#   As a user
#   I want to sign in
#   So I can visit protected areas of the site
feature 'Sign in', :omniauth do

  # Scenario: User can sign in with valid account
  #   Given I have a valid account
  #   And I am not signed in
  #   When I sign in
  #   Then I see a success message
  scenario "user can sign in with valid account" do
    signin
    expect(page).to have_content("test@example.com")
    expect(page).to have_content("Sign out")
  end

  # Scenario: User cannot sign in with invalid account
  #   Given I have no account
  #   And I am not signed in
  #   When I sign in
  #   Then I see an authentication error message
  scenario 'user cannot sign in with invalid account' do
    OmniAuth.config.mock_auth[:twitter] = :invalid_credentials
    visit root_path
    expect(page).to have_content("Sign in")
    click_link "Sign in"
    expect(page).to have_content('Authentication error')
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_apps_testing-0.3.4 lib/generators/testing/configure/templates/spec/omniauth/features/users/sign_in_spec.rb
rails_apps_testing-0.3.3 lib/generators/testing/configure/templates/spec/omniauth/features/users/sign_in_spec.rb