Sha256: a1c6681f4a039f9bd9bce4513ccacd9595de3200da98649125bbd8593cfa6995

Contents?: true

Size: 775 Bytes

Versions: 19

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'

feature "Login" do
  scenario "Login with invalid credentials" do
    sign_in_with_invalid_email
    page.should have_content "invalid"
  end

  scenario "Login with valid credentials" do
    sign_in
    within "h1" do
      page.should have_content "Blogs"
    end
  end

  scenario "Visit login page after logging in" do
    sign_in
    visit "/admin/login"
    within "h1" do
      page.should have_content "Blogs"
    end
  end

  scenario "User logs out" do
    sign_in
    click_link "Logout"
    page.should have_content "Please sign in"
  end

  def sign_in_with_invalid_email
    @user = create(:admin_user)
    visit "/admin"
    fill_in "Email", with: @user.email
    fill_in "Password", with: "wrongpass"
    click_button "Login"
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
brightcontent-core-2.5.1 spec/features/login_spec.rb
brightcontent-core-2.5.0 spec/features/login_spec.rb
brightcontent-core-2.4.6 spec/features/login_spec.rb
brightcontent-core-2.4.5 spec/features/login_spec.rb
brightcontent-core-2.4.4 spec/features/login_spec.rb
brightcontent-core-2.4.3 spec/features/login_spec.rb
brightcontent-core-2.4.2 spec/features/login_spec.rb
brightcontent-core-2.4.1 spec/features/login_spec.rb
brightcontent-core-2.4.0 spec/features/login_spec.rb
brightcontent-core-2.3.4 spec/features/login_spec.rb
brightcontent-core-2.3.3 spec/features/login_spec.rb
brightcontent-core-2.3.2 spec/features/login_spec.rb
brightcontent-core-2.3.1 spec/features/login_spec.rb
brightcontent-core-2.3.0 spec/features/login_spec.rb
brightcontent-core-2.2.2 spec/features/login_spec.rb
brightcontent-core-2.2.1 spec/features/login_spec.rb
brightcontent-core-2.2.0 spec/features/login_spec.rb
brightcontent-core-2.1.5 spec/features/login_spec.rb
brightcontent-core-2.1.4 spec/features/login_spec.rb