diff --git a/spec/models/integrations/flowdock_spec.rb b/spec/models/integrations/flowdock_spec.rb index f2d70a9d945d69a8aef1d134db67b09b53cc3acc..189831fa32db20e1997a1d745a183e4407451c94 100644 --- a/spec/models/integrations/flowdock_spec.rb +++ b/spec/models/integrations/flowdock_spec.rb @@ -29,10 +29,11 @@ describe "Execute" do let(:user) { create(:user) } let(:project) { create(:project, :repository) } - let(:flowdock_integration) { subject } let(:sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) } let(:api_url) { 'https://api.flowdock.com/v1/messages' } + subject(:flowdock_integration) { described_class.new } + before do allow(flowdock_integration).to receive_messages( project_id: project.id, @@ -45,6 +46,7 @@ it "calls FlowDock API" do flowdock_integration.execute(sample_data) + sample_data[:commits].each do |commit| # One request to Flowdock per new commit next if commit[:id] == sample_data[:before]