OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/models/hourly_rate_spec.rb

30 lines
749 B

require File.dirname(__FILE__) + '/../spec_helper'
describe HourlyRate do
let(:project) { FactoryGirl.create(:project) }
let(:user) { FactoryGirl.create(:user) }
let(:rate) { FactoryGirl.build(:hourly_rate, :project => project,
:user => user) }
describe :user do
describe "WHEN an existing user is provided" do
before do
rate.user = user
rate.save!
end
it { rate.user.should == user }
end
describe "WHEN a non existing user is provided (i.e. the user is deleted)" do
before do
rate.user = user
rate.save!
user.destroy
rate.reload
end
it { rate.user.should == DeletedUser.first }
end
end
end