Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moving AR specific tests into AR test directory

  • Loading branch information...
commit 7e85b4c8bcc28b07260b852cf8d57805b0c853fb 1 parent ee62820
@gus gus authored
View
20 test/active_record/context_helper_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
16 test/rails_context_test.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.