Sha256: abbf7c7c3a27e598feb94974702160c144e18af0b6b4526e51003b1bfa0b71e2

Contents?: true

Size: 835 Bytes

Versions: 1

Compression:

Stored size: 835 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

RSpec.describe "Auth log in", type: :feature do
  describe "with locked user" do
    it "fails with error message before lock timeout expires" do
      create(:user, :locked, locked_at: 59.minutes.ago, email: "me@example.com")

      visit "/account/login"

      fill_in_login_form_with("me@example.com", "password")
      click_button "Log in"

      expect(page).to have_content("Your account is locked.")
    end

    it "is successful with recently unlocked user after lock timeout expired" do
      create(:user, :locked, locked_at: 61.minutes.ago, email: "me@example.com")

      visit "/account/login"

      fill_in_login_form_with("me@example.com", "password")
      click_button "Log in"

      expect(page).to have_content("Signed in successfully.")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.4.0 spec/features/auth/log_in/locked_spec.rb