ensl.org/spec/features/servers/server_administration.rb
Ari Timonen 758dfda988 Update for rails 4
Mostly tests
2019-10-17 21:29:15 +03:00

30 lines
692 B
Ruby

require 'rails_helper'
feature 'Server Administration' do
let!(:admin) { create :user, :admin }
background do
sign_in_as admin
end
scenario 'creating a server' do
visit servers_path
expect(page).to have_content('Listing Servers')
click_link 'New server'
test_server_creation_and_editing
visit servers_path
expect(page).to have_content Server.last.name
end
feature 'Server deletion' do
let!(:server) { create :server }
scenario 'deleting a server' do
visit servers_path
expect(page).to have_content(server.name)
visit server_path(server)
click_link 'Delete Server'
visit servers_path
expect(page).to_not have_content(server.name)
end
end
end