Commit 6191e44e3ee4dfef6a78c5dfe9cf96d41f6e04e1
1 parent
e0ff252a
Exists in
master
and in
1 other branch
per_page field at user profile page
Showing
2 changed files
with
15 additions
and
0 deletions
Show diff stats
app/views/users/_fields.html.haml
spec/controllers/users_controller_spec.rb
| 1 | 1 | require 'spec_helper' |
| 2 | 2 | |
| 3 | 3 | describe UsersController do |
| 4 | + render_views | |
| 4 | 5 | |
| 5 | 6 | it_requires_authentication |
| 6 | 7 | it_requires_admin_privileges :for => { |
| ... | ... | @@ -28,6 +29,11 @@ describe UsersController do |
| 28 | 29 | get :edit, :id => @user.id |
| 29 | 30 | assigns(:user).should == @user |
| 30 | 31 | end |
| 32 | + | |
| 33 | + it "should have per_page option" do | |
| 34 | + get :edit, :id => @user.id | |
| 35 | + response.body.should match(/id="user_per_page"/) | |
| 36 | + end | |
| 31 | 37 | end |
| 32 | 38 | |
| 33 | 39 | context "PUT /users/:other_id" do |
| ... | ... | @@ -53,6 +59,11 @@ describe UsersController do |
| 53 | 59 | put :update, :id => @user.to_param, :user => {:admin => true} |
| 54 | 60 | @user.reload.admin.should be_false |
| 55 | 61 | end |
| 62 | + | |
| 63 | + it "should be able to set per_page option" do | |
| 64 | + put :update, :id => @user.to_param, :user => {:per_page => 555} | |
| 65 | + @user.reload.per_page.should == 555 | |
| 66 | + end | |
| 56 | 67 | end |
| 57 | 68 | |
| 58 | 69 | context "when the update is unsuccessful" do | ... | ... |