Permalink
Browse files

Moving AR specific tests into AR test directory

  • Loading branch information...
gus committed May 8, 2010
1 parent ee62820 commit 7e85b4c8bcc28b07260b852cf8d57805b0c853fb
Showing with 21 additions and 15 deletions.
  1. +20 −0 test/active_record/context_helper_test.rb
  2. +1 −15 test/rails_context_test.rb
@@ -0,0 +1,20 @@
+require 'teststrap'
+
+context "The rails_context macro" do
+ setup_test_context
+
+ context "for an ActiveRecord class" do
+ setup do
+ situation = Riot::Situation.new
+ topic.rails_context(Room) do
+ hookup { topic.email = "i.am@chee.se" }
+ end.local_run(Riot::SilentReporter.new, situation)
+ situation.topic
+ end
+
+ asserts_topic.kind_of(Room)
+ asserts(:new_record?)
+ asserts(:email).equals("i.am@chee.se")
+ end # for an ActiveRecord class
+
+end # The rails_context macro
View
@@ -56,20 +56,6 @@
asserts("situation.topic") { topic.topic }.nil
end # with description as a string
- context "for an ActiveRecord class" do
- setup do
- situation = Riot::Situation.new
- topic.rails_context(Room) do
- hookup { topic.email = "i.am@chee.se" }
- end.local_run(Riot::SilentReporter.new, situation)
- situation.topic
- end
-
- asserts_topic.kind_of(Room)
- asserts(:new_record?)
- asserts(:email).equals("i.am@chee.se")
- end # for an ActiveRecord class
-
context "for an ActionController class" do
setup do
situation = Riot::Situation.new
@@ -94,7 +80,7 @@ def self.context(description, context_class, &definition)
end
end
- hookup { topic.rails_context(Room) {} }
+ hookup { topic.rails_context(Object) {} }
asserts(:defined_contexts).size(1)
asserts("context type") { topic.defined_contexts.first }.kind_of(RiotRails::RailsContext)

0 comments on commit 7e85b4c

Please sign in to comment.