Skip to content

Commit

Permalink
#1353 - Prasanna/Suganthi - Fixed bugs in Admin update user page
Browse files Browse the repository at this point in the history
  • Loading branch information
Suganthi T committed Oct 23, 2012
1 parent c1d604f commit 907e60d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--color
--format progress
--order default
--backtrace
--profile
--require rspec/instafail
--format RSpec::Instafail
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ end
group :test do
gem 'mocha'
gem 'test_declarative'
gem 'rspec-instafail'
end

group :cucumber do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ GEM
rspec-core (2.11.1)
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-instafail (0.2.4)
rspec-mocks (2.11.2)
rspec-rails (2.11.0)
actionpack (>= 3.0)
Expand Down Expand Up @@ -224,6 +225,7 @@ DEPENDENCIES
rcov
rest-client (= 1.3.0)
rspec (= 2.11.0)
rspec-instafail
rspec-rails (= 2.11.0)
sass
selenium-webdriver (= 2.24.0)
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class UsersController < ApplicationController

before_filter :administrators_only, :except =>[:show, :edit, :update]
before_filter :set_permissions_params, :only => [:create ]
before_filter :set_permissions_params, :only => [:update, :create ]

def index
@users = User.view("by_full_name")
Expand Down Expand Up @@ -79,6 +79,7 @@ def destroy
private

def set_permissions_params
return unless app_session.admin?
permissions = []
user = params[:user]

Expand Down
1 change: 1 addition & 0 deletions capybara_features/edit_user_details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Scenario: Admin should not see "Disable" control or change user type control whe
Scenario: User should be able to edit their own general information, but should not be able to edit their devices
Given "mary" is logged in
And I follow "Account"
And I click text "Edit"
Then I should not see "IMEI"
Then the "Organisation" field should be disabled

Expand Down

0 comments on commit 907e60d

Please sign in to comment.