Skip to content

Commit

Permalink
Fixed stubbing of User.salt in specs to remove interfile dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Xia committed Feb 26, 2012
1 parent 4b72978 commit c7a9bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/controllers/accounts_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
describe "A successful login with 'Remember me' checked" do
it 'should not cause password to change' do
Factory(:blog)
User.stub(:salt).and_return 'change-me'
henri = Factory(:user, :login => 'henri', :password => 'testagain')
User.salt = 'change-me'
post 'login', {:user => {:login => 'henri', :password => 'testagain'}, :remember_me => '1'}
request.session[:user_id].should == henri.id
end
Expand All @@ -14,8 +14,8 @@
describe 'A successfully authenticated login' do
before(:each) do
Factory(:blog)
@henri = Factory(:user, :login => 'henri', :password => 'testagain', :profile => Factory(:profile_admin, :label => 'admin_henri'))
User.stub!(:salt).and_return('change-me')
@henri = Factory(:user, :login => 'henri', :password => 'testagain', :profile => Factory(:profile_admin, :label => 'admin_henri'))
end

def make_request
Expand Down
4 changes: 3 additions & 1 deletion spec/controllers/backend_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
require 'spec_helper'
require 'action_web_service/test_invoke'

User.salt = 'change-me'

describe BackendController do
before :each do
User.stub(:salt).and_return('change-me')
end
include ActionWebService::TestInvoke::InstanceMethods

before do
Expand Down

0 comments on commit c7a9bb9

Please sign in to comment.