Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created April 12, 2011 00:50
Show Gist options
  • Save myronmarston/914700 to your computer and use it in GitHub Desktop.
Save myronmarston/914700 to your computer and use it in GitHub Desktop.
describe Subscription do
describe '#api_representation' do
let(:record) { new_valid_record }
before(:each) do
record.engine_variants.first.should respond_to(:api_representation)
record.engine_variants.first.stub(api_representation: 'ev_api_representation')
record.url_fragments.first.should respond_to(:api_representation)
record.url_fragments.first.stub(api_representation: 'uf_api_representation')
end
subject { record.api_representation }
its([:name]) { should == 'cmoz.campaigns.12' }
its([:queries]) { should == ['foo'] }
its([:engine_variants]) { should == ['ev_api_representation'] }
its([:url_fragments]) { should == ['uf_api_representation'] }
describe "[:schedule]" do
def subject; super[:schedule]; end
its([:start_date]) { should == Date.today }
its([:interval]) { should == 3 }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment