Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1978 Bytes
1 | require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') |
2 | |
3 | describe Admin::PreferencesController do |
4 | dataset :users |
5 | |
6 | it "should allow you to view your preferences" do |
7 | user = login_as(:non_admin) |
8 | get :edit |
9 | response.should be_success |
10 | assigned_user = assigns(:user) |
11 | assigned_user.should == user |
12 | assigned_user.object_id.should_not == user.object_id |
13 | assigned_user.email.should == 'non_admin@example.com' |
14 | end |
15 | |
16 | it "should allow you to save your preferences" do |
17 | login_as :non_admin |
18 | put :update, :user => { :password => '', :password_confirmation => '', :email => 'updated@gmail.com' } |
19 | user = users(:non_admin) |
20 | response.should redirect_to(admin_preferences_path) |
21 | user.email.should == 'updated@gmail.com' |
22 | end |
23 | |
24 | it "should not allow you to update your role through the preferences page" do |
25 | login_as :non_admin |
26 | put :update, 'user' => { :admin => true } |
27 | response.should be_success |
28 | flash[:error].should match(/bad form data/i) |
29 | end |
30 | |
31 | it "should allow you to change your password" do |
32 | login_as :non_admin |
33 | put :update, { :user => { :password => 'funtimes', :password_confirmation => 'funtimes' } } |
34 | user = users(:non_admin) |
35 | user.password.should == user.sha1('funtimes') |
36 | end |
37 | |
38 | it "should use the User.unprotected_attributes for checking valid_params?" do |
39 | User.should_receive(:unprotected_attributes).at_least(:once).and_return([:password, :password_confirmation, :email]) |
40 | login_as :non_admin |
41 | put :update, { :user => { :password => 'funtimes', :password_confirmation => 'funtimes' } } |
42 | end |
43 | |
44 | describe "@body_classes" do |
45 | before do |
46 | login_as(:non_admin) |
47 | end |
48 | it "should return 'reversed' when the action_name is 'edit'" do |
49 | get :edit |
50 | assigns[:body_classes].should == ['reversed'] |
51 | end |
52 | it "should return 'reversed' when the action_name is 'show'" do |
53 | get :show |
54 | assigns[:body_classes].should == ['reversed'] |
55 | end |
56 | end |
57 | end |