2015-05-14 16:27:12 +00:00
|
|
|
module Features
|
|
|
|
module ServerHelpers
|
|
|
|
def test_server_creation_and_editing
|
2015-11-08 09:41:11 +00:00
|
|
|
dns = "ServerDns.com"
|
|
|
|
ip = "192.168.1.1"
|
|
|
|
port = "8000"
|
|
|
|
password = "secret"
|
|
|
|
name = "MyNsServer"
|
|
|
|
description = "My NS Server"
|
|
|
|
irc = "#some_channel"
|
2015-05-14 16:27:12 +00:00
|
|
|
|
|
|
|
visit new_server_path
|
2015-11-08 09:41:11 +00:00
|
|
|
fill_in "Dns", with: dns
|
|
|
|
fill_in "server_ip", with: ip
|
|
|
|
fill_in "server_port", with: port
|
|
|
|
fill_in "Password", with: password
|
|
|
|
fill_in "Name", with: name
|
|
|
|
fill_in "Description", with: description
|
|
|
|
fill_in "Irc", with: irc
|
|
|
|
check "Available for officials?"
|
|
|
|
click_button "Save"
|
2015-05-14 16:27:12 +00:00
|
|
|
|
|
|
|
expect(page).to have_content(dns)
|
|
|
|
expect(page).to have_content("#{ip}:#{port}")
|
|
|
|
expect(page).to have_content(password)
|
|
|
|
expect(page).to have_content(irc)
|
|
|
|
expect(page).to have_content(description)
|
|
|
|
|
2015-11-08 09:41:11 +00:00
|
|
|
click_link "Edit Server"
|
2015-05-14 16:27:12 +00:00
|
|
|
|
2015-11-08 09:41:11 +00:00
|
|
|
fill_in "Dns", with: "#{dns}2"
|
|
|
|
fill_in "server_ip", with: "192.168.1.2"
|
|
|
|
fill_in "server_port", with: "8001"
|
|
|
|
fill_in "Password", with: "#{password}2"
|
|
|
|
fill_in "Name", with: "#{name}2"
|
|
|
|
fill_in "Description", with: "#{description}2"
|
|
|
|
fill_in "Irc", with: "#{irc}2"
|
|
|
|
check "Available for officials?"
|
|
|
|
click_button "Save"
|
2015-05-14 16:27:12 +00:00
|
|
|
|
|
|
|
expect(page).to have_content("192.168.1.2:8001")
|
|
|
|
expect(page).to have_content("#{dns}2")
|
|
|
|
expect(page).to have_content("#{password}2")
|
|
|
|
expect(page).to have_content("#{irc}2")
|
|
|
|
expect(page).to have_content("#{description}2")
|
|
|
|
end
|
|
|
|
end
|
2015-11-08 09:41:11 +00:00
|
|
|
end
|