diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 2aa1b5b60c..2e49906b4e 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -17,7 +17,7 @@ describe Issue do let!(:cost_object) { FactoryGirl.create(:cost_object, project: project) } before(:each) do - User.current = user + User.stub!(:current).and_return(user) end it "should update cost entries on move" do diff --git a/spec/models/time_entry_spec.rb b/spec/models/time_entry_spec.rb index f032ee3499..3b3f142022 100644 --- a/spec/models/time_entry_spec.rb +++ b/spec/models/time_entry_spec.rb @@ -43,7 +43,7 @@ describe TimeEntry do it "should always prefer overridden_costs" do - User.current = user + User.stub!(:current).and_return(user) value = rand(500) time_entry.overridden_costs = value @@ -54,7 +54,7 @@ describe TimeEntry do describe "given rate" do before(:each) do - User.current = user + User.stub!(:current).and_return(user) @default_example = time_entry2 end @@ -136,7 +136,7 @@ describe TimeEntry do describe "default rate" do before(:each) do - User.current = user + User.stub!(:current).and_return(user) @default_example = time_entry2 end diff --git a/spec/models/variable_cost_object_spec.rb b/spec/models/variable_cost_object_spec.rb index 9bf240c0c5..2ee625be20 100644 --- a/spec/models/variable_cost_object_spec.rb +++ b/spec/models/variable_cost_object_spec.rb @@ -8,7 +8,7 @@ describe VariableCostObject do describe 'recreate initial journal' do before do - User.current = user + User.stub!(:current).and_return(user) @variable_cost_object = FactoryGirl.create(:variable_cost_object , :project => project, :author => user) @@ -24,7 +24,7 @@ describe VariableCostObject do let(:cost_object) { VariableCostObject.new } before do - User.current = user + User.stub!(:current).and_return(user) end it { cost_object.author.should == user }