Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'feature/unauthorized_admin_login'

  • Loading branch information...
commit ff901ca3d358c3295d777209c68c11ba68c27b87 2 parents 265525c + cd464e6
@mariovisic mariovisic authored
View
4 app/controllers/admin/base_controller.rb
@@ -9,10 +9,10 @@ class BaseController < InheritedResources::Base
before_filter :require_site
- load_and_authorize_resource
-
before_filter :validate_site_membership
+ load_and_authorize_resource
+
before_filter :set_locale
helper_method :sections, :current_site_url, :site_url, :page_url, :current_ability
View
18 features/admin/login.feature
@@ -6,16 +6,28 @@ Feature: Login
Background:
Given I have the site: "test site" set up
-Scenario: Successful authentication
+Scenario: Successfully logging in
When I go to login
And I fill in "Email" with "admin@locomotiveapp.org"
And I fill in "Password" with "easyone"
And I press "Log in"
Then I should see "Listing pages"
-Scenario: Failed authentication
+Scenario: Attempting to login with an invalid emai or password
When I go to login
And I fill in "Email" with "admin@locomotiveapp.org"
And I fill in "Password" with ""
And I press "Log in"
- Then I should not see "Listing pages"
+ And I should see "Invalid email or password"
+
+Scenario: Attempting to login with an account without a membership
+ Given the following accounts exist:
+ | email | password | password_confirmation |
+ | john@locomotiveapp.org | bluecheese | bluecheese |
+ When I go to login
+ And I fill in "Email" with "john@locomotiveapp.org"
+ And I fill in "Password" with "bluecheese"
+ And I press "Log in"
+ Then I should not see "Listing pages"
+ And I should see "not a member of this site"
Please sign in to comment.
Something went wrong with that request. Please try again.