diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 6 | ||||
-rw-r--r-- | spec/fixtures/users.yml | 15 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 12 |
3 files changed, 29 insertions, 4 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 438fb8c0c..a12d79e82 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -104,7 +104,7 @@ describe UserController, "when signing in" do get :signin, :r => "/list" response.should render_template('sign') post_redirect = get_last_postredirect - post :signin, { :user_signin => { :email => 'silly@localhost', :password => 'jonespassword' }, + post :signin, { :user_signin => { :email => 'unconfirmed@localhost', :password => 'jonespassword' }, :token => post_redirect.token } response.should render_template('confirm') @@ -116,7 +116,7 @@ describe UserController, "when signing in" do get :signin, :r => "/list" post_redirect = get_last_postredirect - post :signin, { :user_signin => { :email => 'silly@localhost', :password => 'jonespassword' }, + post :signin, { :user_signin => { :email => 'unconfirmed@localhost', :password => 'jonespassword' }, :token => post_redirect.token } response.should send_email @@ -136,7 +136,7 @@ describe UserController, "when signing in" do # check confirmation URL works session[:user_id].should be_nil get :confirm, :email_token => post_redirect.email_token - session[:user_id].should == users(:silly_name_user).id + session[:user_id].should == users(:unconfirmed_user).id response.should redirect_to(:controller => 'request', :action => 'list', :post_redirect => 1) end diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 2485c95a0..e80183c9f 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -20,7 +20,7 @@ silly_name_user: hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 # jonespassword updated_at: 2007-11-01 10:39:15.491593 created_at: 2007-11-01 10:39:15.491593 - email_confirmed: false + email_confirmed: true admin_level: 'none' ban_text: '' about_me: '' @@ -37,3 +37,16 @@ admin_user: admin_level: 'super' ban_text: '' about_me: '' +unconfirmed_user: + id: "4" + name: "Unconfirmed" + url_name: unconfirmed + email: unconfirmed@localhost + salt: "-6116981980.392287733335677" + hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 # jonespassword + updated_at: 2007-11-01 10:39:15.491593 + created_at: 2007-11-01 10:39:15.491593 + email_confirmed: false + admin_level: 'none' + ban_text: '' + about_me: '' diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index fc56d3365..751a61060 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -282,6 +282,18 @@ describe User, "when setting a profile photo" do # end end +describe User, "when unconfirmed" do + fixtures :users + + before do + @user = users(:unconfirmed_user) + end + + it "should not be emailed" do + @user.should_be_emailed?.should be_false + end +end + describe User, "when emails have bounced" do fixtures :users |