Skip to content

Instantly share code, notes, and snippets.

@noam87
Last active August 29, 2015 14:23
Show Gist options
  • Save noam87/56bd4de7be7e023ffc49 to your computer and use it in GitHub Desktop.
Save noam87/56bd4de7be7e023ffc49 to your computer and use it in GitHub Desktop.
describe 'sponsored pushes' do
@league = create(:soccer_league) # <- .create() not in context outside of let/before blocks
@job_data = { # <- can't be defined inside let block if used in before(:context)
tube: @tube_name,
message: @message,
article_uri: @article_uri,
category: @category,
league: @league
primary_tag_uris: @primary_tag_uris,
resource_uris: @resource_uris
}
before do # <- needs access to @league
create(:campaign_sponsored_push, league: league.slug, device: ['android'], message: 'Presented by rspec')
end
context 'when a sponsored push campaign is active' do
before(:context) do
Beanshed.enqueue(tube_name, @job_data) # <- needs access to @job_data
Beanshed::Test.tick_all
end
it 'generates the correct numbner of payloads' do
end
it 'generates the correct tags for UA' do
end
it 'generates and sends the right tags to UrbanAirship' do
end
end
end
@ofer987
Copy link

ofer987 commented Jun 18, 2015

You are not using RSpec properly

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