Initial commit
This commit is contained in:
0
test/controllers/.keep
Normal file
0
test/controllers/.keep
Normal file
49
test/controllers/spaces_controller_test.rb
Normal file
49
test/controllers/spaces_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SpacesControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@space = spaces(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:spaces)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create space" do
|
||||
assert_difference('Space.count') do
|
||||
post :create, space: { address: @space.address, description: @space.description, email: @space.email, hours: @space.hours, name: @space.name, phone: @space.phone, type: @space.type, website: @space.website }
|
||||
end
|
||||
|
||||
assert_redirected_to space_path(assigns(:space))
|
||||
end
|
||||
|
||||
test "should show space" do
|
||||
get :show, id: @space
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @space
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update space" do
|
||||
patch :update, id: @space, space: { address: @space.address, description: @space.description, email: @space.email, hours: @space.hours, name: @space.name, phone: @space.phone, type: @space.type, website: @space.website }
|
||||
assert_redirected_to space_path(assigns(:space))
|
||||
end
|
||||
|
||||
test "should destroy space" do
|
||||
assert_difference('Space.count', -1) do
|
||||
delete :destroy, id: @space
|
||||
end
|
||||
|
||||
assert_redirected_to spaces_path
|
||||
end
|
||||
end
|
||||
0
test/fixtures/.keep
vendored
Normal file
0
test/fixtures/.keep
vendored
Normal file
21
test/fixtures/spaces.yml
vendored
Normal file
21
test/fixtures/spaces.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
type:
|
||||
address: MyString
|
||||
hours: MyString
|
||||
phone: MyString
|
||||
email: MyString
|
||||
website: MyString
|
||||
description: MyText
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
type:
|
||||
address: MyString
|
||||
hours: MyString
|
||||
phone: MyString
|
||||
email: MyString
|
||||
website: MyString
|
||||
description: MyText
|
||||
0
test/helpers/.keep
Normal file
0
test/helpers/.keep
Normal file
4
test/helpers/spaces_helper_test.rb
Normal file
4
test/helpers/spaces_helper_test.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SpacesHelperTest < ActionView::TestCase
|
||||
end
|
||||
0
test/integration/.keep
Normal file
0
test/integration/.keep
Normal file
0
test/mailers/.keep
Normal file
0
test/mailers/.keep
Normal file
0
test/models/.keep
Normal file
0
test/models/.keep
Normal file
7
test/models/space_test.rb
Normal file
7
test/models/space_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SpaceTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
15
test/test_helper.rb
Normal file
15
test/test_helper.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
ENV["RAILS_ENV"] ||= "test"
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
ActiveRecord::Migration.check_pending!
|
||||
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||
#
|
||||
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
||||
# -- they do not yet inherit this setting
|
||||
fixtures :all
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
Reference in New Issue
Block a user