spec/callbacks_spec.rb in machinist_callbacks-0.1.3 vs spec/callbacks_spec.rb in machinist_callbacks-0.2.0
- old
+ new
@@ -107,7 +107,37 @@
director.movies[0].should be_new_record
end
end
+ %w[before_make after_make].each do |before_or_after_make|
+
+ describe "multiple #{before_or_after_make}s" do
+
+ before :each do
+
+ Movie.blueprint do
+ title "title"
+ year 1980
+ send(before_or_after_make) do
+ self.title = "The Good"
+ end
+ send(before_or_after_make) do
+ self.title << ", the Bad"
+ end
+ send(before_or_after_make) do
+ self.title << " and the Ugly"
+ end
+ end
+
+ end
+
+ it 'should all be run' do
+ movie = Movie.make
+ movie.title.should == 'The Good, the Bad and the Ugly'
+ end
+ end
+
+ end
+
end