diff options
Diffstat (limited to 'spec/models/integrations/discord_spec.rb')
-rw-r--r-- | spec/models/integrations/discord_spec.rb | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/spec/models/integrations/discord_spec.rb b/spec/models/integrations/discord_spec.rb index bff6a8ee5b2..b85620782c1 100644 --- a/spec/models/integrations/discord_spec.rb +++ b/spec/models/integrations/discord_spec.rb @@ -11,7 +11,9 @@ RSpec.describe Integrations::Discord do embeds: [ include( author: include(name: be_present), - description: be_present + description: be_present, + color: be_present, + timestamp: be_present ) ] } @@ -33,7 +35,6 @@ RSpec.describe Integrations::Discord do allow(subject).to receive_messages( project: project, project_id: project.id, - service_hook: true, webhook: webhook_url ) @@ -47,15 +48,19 @@ RSpec.describe Integrations::Discord do allow(client).to receive(:execute).and_yield(builder) end - subject.execute(sample_data) + freeze_time do + subject.execute(sample_data) - expect(builder.to_json_hash[:embeds].first).to include( - description: start_with("#{user.name} pushed to branch [master](http://localhost/#{project.namespace.path}/#{project.path}/commits/master) of"), - author: hash_including( - icon_url: start_with('https://www.gravatar.com/avatar/'), - name: user.name + expect(builder.to_json_hash[:embeds].first).to include( + description: start_with("#{user.name} pushed to branch [master](http://localhost/#{project.namespace.path}/#{project.path}/commits/master) of"), + author: hash_including( + icon_url: start_with('https://www.gravatar.com/avatar/'), + name: user.name + ), + color: 16543014, + timestamp: Time.now.utc.iso8601 ) - ) + end end context 'DNS rebind to local address' do |