Commit 11e0e0c2 authored by John E. Vincent's avatar John E. Vincent

working on pending specs in configurations model

parent 09fc8c27
......@@ -11,6 +11,8 @@ class Configuration < Ohm::Model
reference :application, Application
index :name
index :format
index :body
def validate
assert_present :name
......
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Using the Configuration Model", :reset_redis => true do
before(:all) do
@appdata1 = {:name => "my_application"}
@appconf_string = {:name => "mystringconf", :format => "string", :body => "some_var"}
@appconf_json = {:name => "myjsonconf", :format => "json", :body => @appconf_string.to_json}
end
before(:each) do
Ohm.redis.flushdb
end
after(:each) do
Ohm.redis.flushdb
end
describe "should" do
it "create a new Configuration"
it "create a new Configuration via find_or_create"
it "create a new Configuration" do
c = Configuration.create(@appconf_string)
c.valid?.should == true
c.is_new?.should == true
b = Configuration[c.id]
b.should == c
end
it "create a new Configuration via find_or_create" do
c = Configuration.find_or_create(@appconf_string)
c.valid?.should == true
c.is_new?.should == true
a = Configuration[c.id]
a.should == c
end
it "update an existing Configuration via find_or_create"
it "delete an existing Configuration"
it "return all Configurations"
......
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