summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-21 18:48:22 +0100
committerRémy Coutable <remy@rymai.me>2017-02-21 18:48:22 +0100
commit4f115a090a931c3999f6b51d9fa027165b96b618 (patch)
tree2343c693a3402a55d03eb5bbf7f384693b85add3 /spec
parent71270f80dd42e524a904a3c19f23217e8766e282 (diff)
downloadgitlab-ce-4f115a090a931c3999f6b51d9fa027165b96b618.tar.gz
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec')
-rw-r--r--spec/features/variables_spec.rb28
1 files changed, 11 insertions, 17 deletions
diff --git a/spec/features/variables_spec.rb b/spec/features/variables_spec.rb
index a07eba2f01e..a362d6fd3b6 100644
--- a/spec/features/variables_spec.rb
+++ b/spec/features/variables_spec.rb
@@ -16,18 +16,17 @@ describe 'Project variables', js: true do
it 'shows list of variables' do
page.within('.variables-table') do
expect(page).to have_content(variable.key)
- expect(page).to have_content(variable.value)
end
end
it 'adds new variable' do
- fill_in('variable_key', with: 'new_key')
- fill_in('variable_value', with: 'new value')
+ fill_in('variable_key', with: 'key')
+ fill_in('variable_value', with: 'key value')
click_button('Add new variable')
+ expect(page).to have_content('Variables were successfully updated.')
page.within('.variables-table') do
- expect(page).to have_content('new_key')
- expect(page).to have_content('new value')
+ expect(page).to have_content('key')
end
end
@@ -36,6 +35,7 @@ describe 'Project variables', js: true do
fill_in('variable_value', with: '')
click_button('Add new variable')
+ expect(page).to have_content('Variables were successfully updated.')
page.within('.variables-table') do
expect(page).to have_content('new_key')
end
@@ -80,16 +80,12 @@ describe 'Project variables', js: true do
end
expect(page).to have_content('Update variable')
- fill_in('variable_key', with: 'new_key')
- fill_in('variable_value', with: 'new value')
+ fill_in('variable_key', with: 'key')
+ fill_in('variable_value', with: 'key value')
click_button('Save variable')
- page.within('.variables-table') do
- expect(page).not_to have_content(variable.key)
- expect(page).not_to have_content(variable.value)
- expect(page).to have_content('new_key')
- expect(page).to have_content('new value')
- end
+ expect(page).to have_content('Variable was successfully updated.')
+ expect(project.variables.first.value).to eq('key value')
end
it 'edits variable with empty value' do
@@ -101,9 +97,7 @@ describe 'Project variables', js: true do
fill_in('variable_value', with: '')
click_button('Save variable')
- page.within('.variables-table') do
- expect(page).to have_content(variable.key)
- expect(page).not_to have_content(variable.value)
- end
+ expect(page).to have_content('Variable was successfully updated.')
+ expect(project.variables.first.value).to eq('')
end
end