Commit e0e0b66b authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch 'sd5869/use_example_in_rspecs' into 'master'

use example.org instead of example2.com for tests

See merge request gitlab-org/gitlab!77473
parents f5209507 a837119b
......@@ -335,45 +335,45 @@ RSpec.describe ApplicationSetting do
describe '#elasticsearch_url_with_credentials' do
it 'embeds credentials in the result' do
setting.elasticsearch_url = 'http://example.com,https://example2.com:9200'
setting.elasticsearch_url = 'http://example.com,https://example.org:9200'
setting.elasticsearch_username = 'foo'
setting.elasticsearch_password = 'bar'
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:bar@example.com https://foo:bar@example2.com:9200])
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:bar@example.com https://foo:bar@example.org:9200])
end
it 'embeds username only' do
setting.elasticsearch_url = 'http://example.com,https://example2.com:9200'
setting.elasticsearch_url = 'http://example.com,https://example.org:9200'
setting.elasticsearch_username = 'foo'
setting.elasticsearch_password = ''
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:@example.com https://foo:@example2.com:9200])
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:@example.com https://foo:@example.org:9200])
end
it 'overrides existing embedded credentials' do
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example2.com:9200'
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example.org:9200'
setting.elasticsearch_username = 'foo'
setting.elasticsearch_password = 'bar'
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:bar@example.com https://foo:bar@example2.com:9200])
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://foo:bar@example.com https://foo:bar@example.org:9200])
end
it 'returns original url if credentials blank' do
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example2.com:9200'
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example.org:9200'
setting.elasticsearch_username = ''
setting.elasticsearch_password = ''
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://username:password@example.com https://test:test@example2.com:9200])
expect(setting.elasticsearch_url_with_credentials).to eq(%w[http://username:password@example.com https://test:test@example.org:9200])
end
it 'encodes the credentials' do
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example2.com:9200'
setting.elasticsearch_url = 'http://username:password@example.com,https://test:test@example.org:9200'
setting.elasticsearch_username = 'foo/admin'
setting.elasticsearch_password = 'b@r'
expect(setting.elasticsearch_url_with_credentials).to eq(%w[
http://foo%2Fadmin:b%40r@example.com
https://foo%2Fadmin:b%40r@example2.com:9200
https://foo%2Fadmin:b%40r@example.org:9200
])
end
end
......
......@@ -36,7 +36,7 @@ RSpec.describe AuditEvents::AuditEventStreamingWorker do
before do
group.external_audit_event_destinations.create!(destination_url: 'http://example.com')
group.external_audit_event_destinations.create!(destination_url: 'http://example1.com')
group.external_audit_event_destinations.create!(destination_url: 'http://example2.com')
group.external_audit_event_destinations.create!(destination_url: 'http://example.org')
end
it 'makes the correct number of HTTP calls' do
......
......@@ -26,7 +26,7 @@ const INVITATIONS_API_MULTIPLE_EMAIL_RESTRICTED = {
const INVITATIONS_API_EMAIL_TAKEN = {
message: {
'email@example2.com': 'Invite email has already been taken',
'email@example.org': 'Invite email has already been taken',
},
status: 'error',
};
......
......@@ -13,7 +13,7 @@ const normalParagraphNode = buildMockParagraphNode(
'This is just normal paragraph. It has multiple sentences.',
);
const identifierParagraphNode = buildMockParagraphNode(
`[another-identifier]: https://example.com "This example has a title" [identifier]: http://example1.com [this link]: http://example2.com`,
`[another-identifier]: https://example.com "This example has a title" [identifier]: http://example1.com [this link]: http://example.org`,
);
describe('rich_content_editor/renderers_render_identifier_paragraph', () => {
......
......@@ -46,7 +46,7 @@ RSpec.describe TriggerableHooks do
describe '.select_active' do
it 'returns hooks that match the active filter' do
TestableHook.create!(url: 'http://example1.com', push_events: true)
TestableHook.create!(url: 'http://example2.com', push_events: true)
TestableHook.create!(url: 'http://example.org', push_events: true)
filter1 = double(:filter1)
filter2 = double(:filter2)
allow(ActiveHookFilter).to receive(:new).twice.and_return(filter1, filter2)
......
......@@ -683,7 +683,7 @@ RSpec.describe Integration do
it "returns initial value when the property has been assigned multiple values" do
service.bamboo_url = "http://example.com"
service.bamboo_url = "http://example2.com"
service.bamboo_url = "http://example.org"
expect(service.bamboo_url_was).to eq('http://gitlab.com')
end
......
......@@ -94,7 +94,7 @@ RSpec.shared_examples 'application settings examples' do
'1:2:3:4:5::7:8',
'[1:2:3:4:5::7:8]',
'[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443',
'www.example2.com:8080',
'www.example.org:8080',
'example.com:8080'
]
......@@ -114,7 +114,7 @@ RSpec.shared_examples 'application settings examples' do
an_object_having_attributes(domain: 'example.com'),
an_object_having_attributes(domain: 'subdomain.example.com'),
an_object_having_attributes(domain: 'www.example.com'),
an_object_having_attributes(domain: 'www.example2.com', port: 8080),
an_object_having_attributes(domain: 'www.example.org', port: 8080),
an_object_having_attributes(domain: 'example.com', port: 8080)
]
......
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