stub current user to prevent side effects

pull/6827/head
Jens Ulferts 11 years ago
parent e97090ca6b
commit 08f95300d4
  1. 2
      spec/models/issue_spec.rb
  2. 6
      spec/models/time_entry_spec.rb
  3. 4
      spec/models/variable_cost_object_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

@ -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

@ -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 }

Loading…
Cancel
Save