
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.81 KB | hits: 18 | expires: Never
require 'spec_helper'
describe FeaturePool do
it "creates a new instance given valid attributes" do
Fabricate :feature_pool
end
it "is not valid without a name" do
Fabricate.build(:feature_pool, :name => "").should_not be_valid
end
describe "#current" do
it "returns the feature appearance whose position corresponds with #head" do
pool = Fabricate :populated_feature_pool
pool.current.featurable.user.name.should == "John Gruber"
end
it "has some feature appearances" do
pool = Fabricate :populated_feature_pool
pool.should have(5).feature_appearances
end
it "persists its appearances" do
Fabricate :populated_feature_pool, :name => "foo/bar"
pool = FeaturePool.find_by_name("foo/bar")
pool.should have(5).feature_appearances
end
end
end