Skip to content

Instantly share code, notes, and snippets.

@deathbob
Created June 23, 2011 20:25
Show Gist options
  • Select an option

  • Save deathbob/1043544 to your computer and use it in GitHub Desktop.

Select an option

Save deathbob/1043544 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Gig do
before do
@gig = Gig.new
@gig.save
end
it "should belong to a user and validate the presence of a user" do
@gig.errors.should have(1).errors_on(:user)
end
it "by default, it should not be featured " do
assert !@gig.featured
end
it 'should not be approved by default' do
assert !@gig.approved
end
it 'should be enabled by default' do
assert @gig.enabled
end
end
@brentkirby

Copy link
Copy Markdown
require 'spec_helper'

describe Gig do

  describe 'a new gig' do
      before(:all) do
        @gig = Gig.new
        @gig.save
      end
      subject{ @gig }

      it { should have(1).errors_on(:user) }
      its(:featured){ should_not be_true }
      its(:approved){ should_not be_true }
      its(:enabled){ should_not be_true }
  end   
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment