summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/factories/ci/variables.rb7
-rw-r--r--spec/requests/api/variables_spec.rb4
2 files changed, 4 insertions, 7 deletions
diff --git a/spec/factories/ci/variables.rb b/spec/factories/ci/variables.rb
index a19b9fc72f2..8f62d64411b 100644
--- a/spec/factories/ci/variables.rb
+++ b/spec/factories/ci/variables.rb
@@ -16,10 +16,7 @@
FactoryGirl.define do
factory :ci_variable, class: Ci::Variable do
- id 10
- key 'TEST_VARIABLE_1'
- value 'VALUE_1'
-
- project factory: :empty_project
+ sequence(:key) { |n| "VARIABLE_#{n}" }
+ value 'VARIABLE_VALUE'
end
end
diff --git a/spec/requests/api/variables_spec.rb b/spec/requests/api/variables_spec.rb
index 214d7d5a0cc..9744729ba0c 100644
--- a/spec/requests/api/variables_spec.rb
+++ b/spec/requests/api/variables_spec.rb
@@ -46,7 +46,7 @@ describe API::API, api: true do
expect(json_response['value']).to eq(variable.value)
end
- it 'should responde with 404 Not Found if requesting non-existing variable' do
+ it 'should respond with 404 Not Found if requesting non-existing variable' do
get api("/projects/#{project.id}/variables/non_existing_variable", user)
expect(response.status).to eq(404)
@@ -84,7 +84,7 @@ describe API::API, api: true do
it 'should not allow to duplicate variable key' do
expect do
- post api("/projects/#{project.id}/variables", user), key: 'TEST_VARIABLE_1', value: 'VALUE_2'
+ post api("/projects/#{project.id}/variables", user), key: variable.key, value: 'VALUE_2'
end.to change{project.variables.count}.by(0)
expect(response.status).to eq(400)