Commit 4e75f4ba authored by John E. Vincent's avatar John E. Vincent

ephemeral tests minus one due to timing issues

parent e5af7b2d
...@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper') ...@@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Using the Ephemeral Model", :reset_redis => true do describe "Using the Ephemeral Model", :reset_redis => true do
before(:all) do before(:all) do
@edata = {:path => "//noah/foo/bar/baz", :data => "some_value"} @edata = {:path => "/foo/bar/baz", :data => "some_value"}
@emissing_path = @edata.reject {|x| x == :path} @emissing_path = @edata.reject {|x| x == :path}
@emissing_data = @edata.reject {|x| x == :data} @emissing_data = @edata.reject {|x| x == :data}
@good_ephemeral = Noah::Ephemeral.new(@edata) @good_ephemeral = Noah::Ephemeral.new(@edata)
...@@ -19,14 +19,34 @@ describe "Using the Ephemeral Model", :reset_redis => true do ...@@ -19,14 +19,34 @@ describe "Using the Ephemeral Model", :reset_redis => true do
it "create a new Noah::Ephemeral" do it "create a new Noah::Ephemeral" do
@good_ephemeral.valid?.should == true @good_ephemeral.valid?.should == true
@good_ephemeral.save @good_ephemeral.save
b = Noah::Ephemeral.find(:path => @edata[:path]).first b = Noah::Ephemeral[@good_ephemeral.id]
b.should == @good_ephemeral b.should == @good_ephemeral
end end
it "create a new Noah::Ephemeral with missing data" it "create a new Noah::Ephemeral with missing data" do
it "update an existing Noah::Ephemeral" @missing_data.valid?.should == true
it "delete an existing Noah::Ephemeral" @missing_data.save
b = Noah::Ephemeral[@missing_data.id]
b.should == @missing_data
end
# it "update an existing Noah::Ephemeral" do
# @good_ephemeral.save
# Noah::Ephemeral.all.size.should == 1
# c = Noah::Ephemeral[@good_ephemeral.id]
# c.data = "updated_data"
# c.save
# sleep(2)
# c.is_new?.should == false
# end
it "delete an existing Noah::Ephemeral" do
@good_ephemeral.save
@good_ephemeral.delete
Noah::Ephemeral[@good_ephemeral.id].should == nil
end
end end
describe "should not" do describe "should not" do
it "create a new Noah::Ephemeral with missing path" it "create a new Noah::Ephemeral with missing path" do
@missing_path.valid?.should == false
@missing_path.errors.should == [[:path, :not_present]]
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment