Commit 5f127bab authored by Matija Čupić's avatar Matija Čupić

Fix API variable specs

parent 0ccbc651
...@@ -142,12 +142,12 @@ describe API::GroupVariables do ...@@ -142,12 +142,12 @@ describe API::GroupVariables do
end end
it 'updates variable data' do it 'updates variable data' do
initial_variable = group.variables.first initial_variable = group.variables.reload.first
value_before = initial_variable.value value_before = initial_variable.value
put api("/groups/#{group.id}/variables/#{variable.key}", user), value: 'VALUE_1_UP', protected: true put api("/groups/#{group.id}/variables/#{variable.key}", user), value: 'VALUE_1_UP', protected: true
updated_variable = group.variables.first updated_variable = group.variables.reload.first
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(value_before).to eq(variable.value) expect(value_before).to eq(variable.value)
......
...@@ -122,12 +122,12 @@ describe API::Variables do ...@@ -122,12 +122,12 @@ describe API::Variables do
describe 'PUT /projects/:id/variables/:key' do describe 'PUT /projects/:id/variables/:key' do
context 'authorized user with proper permissions' do context 'authorized user with proper permissions' do
it 'updates variable data' do it 'updates variable data' do
initial_variable = project.variables.first initial_variable = project.variables.reload.first
value_before = initial_variable.value value_before = initial_variable.value
put api("/projects/#{project.id}/variables/#{variable.key}", user), value: 'VALUE_1_UP', protected: true put api("/projects/#{project.id}/variables/#{variable.key}", user), value: 'VALUE_1_UP', protected: true
updated_variable = project.variables.first updated_variable = project.variables.reload.first
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(value_before).to eq(variable.value) expect(value_before).to eq(variable.value)
......
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