server list looks like something

This commit is contained in:
Senad Uka
2016-02-20 12:36:50 +01:00
parent 3b213c855a
commit 91b72481da
25 changed files with 258 additions and 5 deletions

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class OperatingSystemsControllerTest < ActionController::TestCase
setup do
@operating_system = operating_systems(:one)
end
test 'should get index' do
get :index
assert_response :success
assert_not_nil assigns(:operating_systems)
end
test 'should get new' do
get :new
assert_response :success
end
test 'should create operating_system' do
assert_difference('OperatingSystem.count') do
post :create, operating_system: {}
end
assert_redirected_to operating_system_path(assigns(:operating_system))
end
test 'should show operating_system' do
get :show, id: @operating_system
assert_response :success
end
test 'should get edit' do
get :edit, id: @operating_system
assert_response :success
end
test 'should update operating_system' do
patch :update, id: @operating_system, operating_system: {}
assert_redirected_to operating_system_path(assigns(:operating_system))
end
test 'should destroy operating_system' do
assert_difference('OperatingSystem.count', -1) do
delete :destroy, id: @operating_system
end
assert_redirected_to operating_systems_path
end
end

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class ServersControllerTest < ActionController::TestCase
setup do
@server = servers(:one)
end
test 'should get index' do
get :index
assert_response :success
assert_not_nil assigns(:servers)
end
test 'should get new' do
get :new
assert_response :success
end
test 'should create server' do
assert_difference('Server.count') do
post :create, server: {}
end
assert_redirected_to server_path(assigns(:server))
end
test 'should show server' do
get :show, id: @server
assert_response :success
end
test 'should get edit' do
get :edit, id: @server
assert_response :success
end
test 'should update server' do
patch :update, id: @server, server: {}
assert_redirected_to server_path(assigns(:server))
end
test 'should destroy server' do
assert_difference('Server.count', -1) do
delete :destroy, id: @server
end
assert_redirected_to servers_path
end
end

11
web/test/fixtures/operating_systems.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value

11
web/test/fixtures/servers.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class OperatingSystemTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class ServerTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end