stories/resources/steps/using_rest_adapter.rb in dm-rest-adapter-0.9.3 vs stories/resources/steps/using_rest_adapter.rb in dm-rest-adapter-0.9.4
- old
+ new
@@ -37,45 +37,45 @@
# TODO refactor
require File.join(File.dirname(__FILE__), '..', 'helpers', 'book')
@resource = Book.first
@resource_id = @resource.id
end
-
+
When("I try to save the Resource") do
@result = @resource.save
end
-
+
When("I request all of the Resources of that type") do
require File.join(File.dirname(__FILE__), '..', 'helpers', 'book')
@resources = Book.all
end
-
+
When("I request the Resource") do
- require File.join(File.dirname(__FILE__), '..', 'helpers', 'book')
+ require File.join(File.dirname(__FILE__), '..', 'helpers', 'book')
@resource = Book.get(@resource_id)
end
When("I make valid changes to that Resource") do
@resource.title = "Mary had a little lamb"
end
When("I make invalid changes to that Resource") do
@resource.title = nil
end
-
+
When("I destroy the Resource") do
@resource.destroy
end
-
+
Then("the Resource should save") do
@result.should be_true
end
-
+
Then("the Resource should not save") do
@result.should be_false
end
-
+
Then("I should not receive an empty list") do
@resources.should_not be_empty
end
Then("I should receive that Resource") do
@@ -84,10 +84,10 @@
end
Then("I should get nothing in return") do
@resource.should be_nil
end
-
+
Then("the Resource will no longer be available") do
# TODO refactor
require File.join(File.dirname(__FILE__), '..', 'helpers', 'book')
Book.get(@resource_id).should be_nil
end