Last active
August 29, 2015 14:12
-
-
Save nisanthchunduru/bcd7fbaa88fc3652150a to your computer and use it in GitHub Desktop.
This file contains 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 RepoSynchronizationJob do | |
it 'sets refreshing_repos to true before synchronization' do | |
is_refreshing_repos_set_to_true = Proc.new do |user_id| | |
User.find(user_id).refreshing_repos == true | |
end | |
user = create(:user, refreshing_repos: false) | |
github_token = 'token' | |
expect(user.refreshing_repos).to be_false | |
flexmock(RepoSynchronization).should_receive(:call).with(FlexMock.on(&is_refreshing_repos_set_to_true), Flexmock.any).once | |
RepoSynchronizationJob.new(user_id, github_token).perform_now | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment