Skip to content

Instantly share code, notes, and snippets.

@gen1321
Created April 29, 2016 08:42
Show Gist options
  • Save gen1321/5c771c8da502c3917a93b8ddc07272aa to your computer and use it in GitHub Desktop.
Save gen1321/5c771c8da502c3917a93b8ddc07272aa to your computer and use it in GitHub Desktop.
require 'rails_helper'
describe History ,type: :model do
let(:member){ create(:member) }
let(:channel){ create(:channel) }
let(:create_sub){create(:subscription )}
it 'should be created after subscribe' do
expect{create_sub}.to change{History.count}.by(1)
end
it 'should be created after unsubscribe' do
create_sub
expect{create_sub.destroy}.to change{History.count}.by(1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment