parent
5027a42a8d
commit
ddb2dcbbf8
@ -1,3 +1,6 @@ |
||||
Factory.define :variable_cost_object do |co| |
||||
|
||||
Factory.define :variable_cost_object do |m| |
||||
m.association :project, :factory => :project |
||||
m.sequence(:subject) { |n| "Cost Object No. #{n}" } |
||||
m.sequence(:description) { |n| "I am a Cost Object No. #{n}" } |
||||
m.fixed_date Time.now |
||||
end |
||||
|
@ -0,0 +1,20 @@ |
||||
require File.dirname(__FILE__) + '/../spec_helper' |
||||
|
||||
describe VariableCostObject do |
||||
before(:each) do |
||||
@tracker ||= Factory.create(:tracker_feature) |
||||
@project ||= Factory.create(:project_with_trackers) |
||||
@current = Factory.create(:user, :login => "user1", :mail => "user1@users.com") |
||||
|
||||
User.stub!(:current).and_return(@current) |
||||
end |
||||
|
||||
it 'should work with recreate initial journal' do |
||||
@variable_cost_object ||= Factory.create(:variable_cost_object , :project => @project, :author => @current) |
||||
|
||||
initial_journal = @variable_cost_object.journals.first |
||||
recreated_journal = @variable_cost_object.recreate_initial_journal! |
||||
|
||||
initial_journal.should be_identical(recreated_journal) |
||||
end |
||||
end |
@ -1,26 +1,7 @@ |
||||
RAILS_ENV = "test" unless defined? RAILS_ENV |
||||
|
||||
# prevent case where we are using rubygems and test-unit 2.x is installed |
||||
begin |
||||
require 'rubygems' |
||||
gem "test-unit", "~> 1.2.3" |
||||
rescue LoadError |
||||
end |
||||
|
||||
begin |
||||
#require "config/environment" unless defined? RAILS_ROOT |
||||
require 'spec/spec_helper' |
||||
rescue LoadError => error |
||||
puts <<-EOS |
||||
|
||||
You need to install rspec in your Redmine project. |
||||
Please execute the following code: |
||||
|
||||
gem install rspec-rails |
||||
script/generate rspec |
||||
|
||||
EOS |
||||
raise error |
||||
end |
||||
require 'spec/spec_helper' |
||||
require 'redmine_factory_girl' |
||||
require 'identical_ext' |
||||
|
||||
Fixtures.create_fixtures File.join(File.dirname(__FILE__), "fixtures"), ActiveRecord::Base.connection.tables |
||||
|
Loading…
Reference in new issue