summaryrefslogtreecommitdiff
path: root/spec/models/integrations/packagist_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/integrations/packagist_spec.rb')
-rw-r--r--spec/models/integrations/packagist_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/integrations/packagist_spec.rb b/spec/models/integrations/packagist_spec.rb
index 48f7e81adca..dce96890522 100644
--- a/spec/models/integrations/packagist_spec.rb
+++ b/spec/models/integrations/packagist_spec.rb
@@ -24,23 +24,23 @@ RSpec.describe Integrations::Packagist do
let(:packagist_server) { 'https://packagist.example.com' }
let(:project) { create(:project) }
- describe "Associations" do
- it { is_expected.to belong_to :project }
- it { is_expected.to have_one :service_hook }
+ it_behaves_like Integrations::HasWebHook do
+ let(:integration) { described_class.new(packagist_params) }
+ let(:hook_url) { "#{packagist_server}/api/update-package?username=#{packagist_username}&apiToken=#{packagist_token}" }
end
describe '#execute' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) }
- let(:packagist_service) { described_class.create!(packagist_params) }
+ let(:packagist_integration) { described_class.create!(packagist_params) }
before do
stub_request(:post, packagist_hook_url)
end
it 'calls Packagist API' do
- packagist_service.execute(push_sample_data)
+ packagist_integration.execute(push_sample_data)
expect(a_request(:post, packagist_hook_url)).to have_been_made.once
end