Commit 8173e2fb
Changed files (1)
spec
features
spec/features/logins_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe "Logins" do
describe "GET /logins" do
it "should be able to reach the login page" do
- visit '/login'
+ visit user_session_path
page.should have_content("Got an account? Login!")
end
@@ -11,7 +11,7 @@ describe "Logins" do
let!(:user) { create(:user, :password => "password") }
before :each do
- visit '/login'
+ visit user_session_path
within('.form-inline') do
fill_in('user_email', :with => user.email)
fill_in('user_password', :with => "password")
@@ -27,5 +27,20 @@ describe "Logins" do
page.should_not have_content(I18n.t('devise.failure.invalid'))
end
end
+
+ context "when an email is not known" do
+ before :each do
+ visit user_session_path
+ within('.form-inline') do
+ fill_in('user_email', :with => 'test@example.com')
+ fill_in('user_password', :with => 'password')
+ end
+ click_button "Sign In"
+ end
+
+ it "should display an error message" do
+ page.should have_content(I18n.t('devise.failure.invalid'))
+ end
+ end
end
end