1 # == Schema Information
5 # id :integer not null, primary key
9 # project_id :integer not null
10 # created_at :datetime not null
11 # updated_at :datetime not null
12 # active :boolean default(FALSE), not null
13 # project_url :string(255)
14 # subdomain :string(255)
20 describe FlowdockService do
21 describe "Associations" do
22 it { should belong_to :project }
23 it { should have_one :service_hook }
27 let(:user) { create(:user) }
28 let(:project) { create(:project_with_code) }
31 @flowdock_service = FlowdockService.new
32 @flowdock_service.stub(
33 project_id: project.id,
38 @sample_data = GitPushService.new.sample_data(project, user)
39 @api_url = 'https://api.flowdock.com/v1/git/verySecret'
40 WebMock.stub_request(:post, @api_url)
43 it "should call FlowDock API" do
44 @flowdock_service.execute(@sample_data)
45 WebMock.should have_requested(:post, @api_url).with(
46 body: /#{@sample_data[:before]}.*#{@sample_data[:after]}.*#{project.path}/