Skip to content

Instantly share code, notes, and snippets.

@nisanthchunduru
Last active August 29, 2015 14:12
Show Gist options
  • Save nisanthchunduru/bcd7fbaa88fc3652150a to your computer and use it in GitHub Desktop.
Save nisanthchunduru/bcd7fbaa88fc3652150a to your computer and use it in GitHub Desktop.
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