Commit 1c2f790e authored by Alex Kalderimis's avatar Alex Kalderimis

Make spec more robust by scoping to project

Also, freeze the test time so that we don't have to worry about time
drift during test runs.
parent e1fb3ec9
......@@ -5,6 +5,10 @@ require 'spec_helper'
RSpec.describe WebHook do
let(:hook) { build(:project_hook) }
around do |example|
travel_to(Time.current) { example.run }
end
describe 'associations' do
it { is_expected.to have_many(:web_hook_logs) }
end
......@@ -121,7 +125,7 @@ RSpec.describe WebHook do
create(:project_hook, project: project, recent_failures: recent_failures, disabled_until: disabled_until)
end
expect(described_class.executable).to match_array executables
expect(described_class.where(project_id: project.id).executable).to match_array executables
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment