spec/wally/feature_spec.rb in wally-0.0.33 vs spec/wally/feature_spec.rb in wally-0.0.34
- old
+ new
@@ -1,29 +1,26 @@
require File.join(File.dirname(__FILE__), "..", "spec_helper")
module Wally
describe Feature do
- after do
- Feature.delete_all
- end
-
- subject { Feature.new }
-
it "stores a feature path" do
- subject.path = "hello.feature"
- subject.save
- Feature.all.first.path.should == "hello.feature"
+ project = project("project")
+ project.features << Feature.new(:path => "hello.feature")
+ project.save
+ Project.first.features.first.path.should == "hello.feature"
end
it "stores the feature content" do
- subject.gherkin = {"meh" => "ble"}
- subject.save
- Feature.all.first.gherkin.should == {"meh" => "ble"}
+ project = project("project")
+ project.features << Feature.new(:gherkin => {"meh" => "ble"})
+ project.save
+ Project.first.features.first.gherkin.should == {"meh" => "ble"}
end
it "stores the feature name" do
- subject.gherkin = {"name" => "ble"}
- subject.save
- Feature.all.first.name.should == "ble"
+ project = project("project")
+ project.features << Feature.new(:gherkin => {"name" => "ble"})
+ project.save
+ Project.first.features.first.name.should == "ble"
end
end
end