creation of categories ready

This commit is contained in:
Senad Uka
2015-01-14 07:29:44 +01:00
parent 4b8c8a444c
commit 8384bcbd30
63 changed files with 1127 additions and 28 deletions

0
test/controllers/.keep Normal file
View File

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class CategoriesControllerTest < ActionController::TestCase
setup do
@category = categories(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:categories)
end
test "should get new" do
get :new
assert_response :success
end
test "should create category" do
assert_difference('Category.count') do
post :create, category: { name: @category.name }
end
assert_redirected_to category_path(assigns(:category))
end
test "should show category" do
get :show, id: @category
assert_response :success
end
test "should get edit" do
get :edit, id: @category
assert_response :success
end
test "should update category" do
patch :update, id: @category, category: { name: @category.name }
assert_redirected_to category_path(assigns(:category))
end
test "should destroy category" do
assert_difference('Category.count', -1) do
delete :destroy, id: @category
end
assert_redirected_to categories_path
end
end

0
test/fixtures/.keep vendored Normal file
View File

7
test/fixtures/categories.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: MyString
two:
name: MyString

0
test/helpers/.keep Normal file
View File

0
test/integration/.keep Normal file
View File

0
test/mailers/.keep Normal file
View File

0
test/models/.keep Normal file
View File

View File

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

10
test/test_helper.rb Normal file
View File

@@ -0,0 +1,10 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end