Commit 14738fae authored by Ash McKenzie's avatar Ash McKenzie

primary_repo can be a String or a Hash

parent 4656cd71
...@@ -26,13 +26,22 @@ describe Action::Custom do ...@@ -26,13 +26,22 @@ describe Action::Custom do
end end
context 'that are valid' do context 'that are valid' do
where(:primary_repo_data) do
[
[ 'http://localhost:3001/user1/repo1.git' ],
[{ 'http' => 'http://localhost:3001/user1/repo1.git' }],
[{ 'http' => 'http://localhost:3001/user1/repo1.git', 'ssh' => 'ssh://user@localhost:3002/user1/repo1.git' }]
]
end
with_them do
let(:payload) do let(:payload) do
{ {
'action' => 'geo_proxy_to_primary', 'action' => 'geo_proxy_to_primary',
'data' => { 'data' => {
'api_endpoints' => %w{/api/v4/fake/info_refs /api/v4/fake/push}, 'api_endpoints' => %w{/api/v4/fake/info_refs /api/v4/fake/push},
'gl_username' => 'user1', 'gl_username' => 'user1',
'primary_repo' => 'http://localhost:3001/user1/repo1.git' 'primary_repo' => primary_repo_data
} }
} }
end end
...@@ -76,6 +85,7 @@ describe Action::Custom do ...@@ -76,6 +85,7 @@ describe Action::Custom do
end end
end end
end end
end
context 'that are invalid' do context 'that are invalid' do
context 'where api_endpoints gl_id is missing' do context 'where api_endpoints gl_id is missing' do
......
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