Skip to content

Instantly share code, notes, and snippets.

@quinn
Created November 4, 2008 22:18
Show Gist options
  • Save quinn/22233 to your computer and use it in GitHub Desktop.
Save quinn/22233 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/../spec_helper'
describe 'a band\'s preferences' do
fixtures :groups, :users, :emails
before(:each) do
@band = groups(:pfunk)
@band.should be_is_a Band # pref definition is in band
@band.class.base_class.should == Group # base class is group
end
it 'should include prefers_private_songs' do
@band.should respond_to(:prefers_private_songs)
end
describe 'should include prefers_private_songs which' do
it 'should default to false' do
@band.prefers_private_songs.should == false
end
# spec fails with
# undefined method `preference_definitions' for #<Class:0x37b3a4c>
it 'should be settable' do
@band.prefers_private_songs= true
@band.save!
@band.reload.prefers_private_songs.should == true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment