Last active
August 29, 2015 14:23
-
-
Save noam87/56bd4de7be7e023ffc49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are not using RSpec properly