Add feature testing support

This commit is contained in:
Martin Lensment 2014-08-18 12:26:55 +03:00
parent eaa9b015e2
commit d9240aa4f8
12 changed files with 123 additions and 37 deletions

View file

@ -0,0 +1,37 @@
require 'rails_helper'
feature 'Setting management' do
background { Fabricate(:setting_group) }
scenario 'User changes a setting', js: true do
visit root_path
# This ensures javascript works correctly
expect(page).to have_no_link 'Setting groups'
click_on 'Settings'
expect(page).to have_link 'Setting groups'
click_on 'Setting groups'
expect(page).to have_text('Domain validation')
click_on 'Edit settings'
expect(page).to have_text('Nameserver minimum count')
expect(page).to have_text('Nameserver maximum count')
val_min = find_field('Nameserver minimum count').value
val_max = find_field('Nameserver maximum count').value
expect(val_min).to eq('1')
expect(val_max).to eq('13')
fill_in('Nameserver minimum count', with: '3')
fill_in('Nameserver maximum count', with: '10')
click_on 'Save'
val_min = find_field('Nameserver minimum count').value
val_max = find_field('Nameserver maximum count').value
expect(val_min).to eq('3')
expect(val_max).to eq('10')
end
end