spec/unit/mock_user_spec.rb in warden-github-rails-1.1.1 vs spec/unit/mock_user_spec.rb in warden-github-rails-1.1.2
- old
+ new
@@ -1,9 +1,9 @@
require 'spec_helper'
describe Warden::GitHub::Rails::TestHelpers::MockUser do
- it { should be_a Warden::GitHub::User }
+ it { is_expected.to be_a Warden::GitHub::User }
describe '#stub_membership' do
subject(:user) { described_class.new }
it 'stubs memberships' do
@@ -15,7 +15,15 @@
expect(user).to be_team_member(123)
expect(user).to be_team_member(456)
expect(user).to be_organization_member('foobar')
end
+ end
+
+ it 'can be marshaled' do
+ user = described_class.new
+ user.stub_membership(org: ['apple', 'facebook'], team: [12, 34])
+ marshaled_user = Marshal.load(Marshal.dump(user))
+
+ expect(marshaled_user.memberships).to eq(user.memberships)
end
end