Commit 68658c2e authored by Alex Kalderimis's avatar Alex Kalderimis

Use a named subject

parent 54acf9bb
...@@ -29,10 +29,11 @@ RSpec.describe Integrations::Flowdock do ...@@ -29,10 +29,11 @@ RSpec.describe Integrations::Flowdock do
describe "Execute" do describe "Execute" do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:flowdock_integration) { subject }
let(:sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) } let(:sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
let(:api_url) { 'https://api.flowdock.com/v1/messages' } let(:api_url) { 'https://api.flowdock.com/v1/messages' }
subject(:flowdock_integration) { described_class.new }
before do before do
allow(flowdock_integration).to receive_messages( allow(flowdock_integration).to receive_messages(
project_id: project.id, project_id: project.id,
...@@ -45,6 +46,7 @@ RSpec.describe Integrations::Flowdock do ...@@ -45,6 +46,7 @@ RSpec.describe Integrations::Flowdock do
it "calls FlowDock API" do it "calls FlowDock API" do
flowdock_integration.execute(sample_data) flowdock_integration.execute(sample_data)
sample_data[:commits].each do |commit| sample_data[:commits].each do |commit|
# One request to Flowdock per new commit # One request to Flowdock per new commit
next if commit[:id] == sample_data[:before] next if commit[:id] == sample_data[:before]
......
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