added filter criteria models
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class FilterCriteriaControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@filter_criterium = filter_criteria(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:filter_criteria)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create filter_criterium" do
|
||||
assert_difference('FilterCriterium.count') do
|
||||
post :create, filter_criterium: { field_name: @filter_criterium.field_name, owner_id: @filter_criterium.owner_id, owner_type: @filter_criterium.owner_type, title: @filter_criterium.title, type: @filter_criterium.type }
|
||||
end
|
||||
|
||||
assert_redirected_to filter_criterium_path(assigns(:filter_criterium))
|
||||
end
|
||||
|
||||
test "should show filter_criterium" do
|
||||
get :show, id: @filter_criterium
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @filter_criterium
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update filter_criterium" do
|
||||
patch :update, id: @filter_criterium, filter_criterium: { field_name: @filter_criterium.field_name, owner_id: @filter_criterium.owner_id, owner_type: @filter_criterium.owner_type, title: @filter_criterium.title, type: @filter_criterium.type }
|
||||
assert_redirected_to filter_criterium_path(assigns(:filter_criterium))
|
||||
end
|
||||
|
||||
test "should destroy filter_criterium" do
|
||||
assert_difference('FilterCriterium.count', -1) do
|
||||
delete :destroy, id: @filter_criterium
|
||||
end
|
||||
|
||||
assert_redirected_to filter_criteria_path
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class FilterCriteriaValuesControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@filter_criteria_value = filter_criteria_values(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:filter_criteria_values)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create filter_criteria_value" do
|
||||
assert_difference('FilterCriteriaValue.count') do
|
||||
post :create, filter_criteria_value: { filter_criteria_id: @filter_criteria_value.filter_criteria_id, filter_text: @filter_criteria_value.filter_text, filter_value: @filter_criteria_value.filter_value }
|
||||
end
|
||||
|
||||
assert_redirected_to filter_criteria_value_path(assigns(:filter_criteria_value))
|
||||
end
|
||||
|
||||
test "should show filter_criteria_value" do
|
||||
get :show, id: @filter_criteria_value
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @filter_criteria_value
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update filter_criteria_value" do
|
||||
patch :update, id: @filter_criteria_value, filter_criteria_value: { filter_criteria_id: @filter_criteria_value.filter_criteria_id, filter_text: @filter_criteria_value.filter_text, filter_value: @filter_criteria_value.filter_value }
|
||||
assert_redirected_to filter_criteria_value_path(assigns(:filter_criteria_value))
|
||||
end
|
||||
|
||||
test "should destroy filter_criteria_value" do
|
||||
assert_difference('FilterCriteriaValue.count', -1) do
|
||||
delete :destroy, id: @filter_criteria_value
|
||||
end
|
||||
|
||||
assert_redirected_to filter_criteria_values_path
|
||||
end
|
||||
end
|
||||
15
back-office/test/fixtures/filter_criteria.yml
vendored
Normal file
15
back-office/test/fixtures/filter_criteria.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
title: MyString
|
||||
field_name: MyString
|
||||
type: 1
|
||||
owner_type: MyString
|
||||
owner_id: 1
|
||||
|
||||
two:
|
||||
title: MyString
|
||||
field_name: MyString
|
||||
type: 1
|
||||
owner_type: MyString
|
||||
owner_id: 1
|
||||
11
back-office/test/fixtures/filter_criteria_values.yml
vendored
Normal file
11
back-office/test/fixtures/filter_criteria_values.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
filter_text: MyString
|
||||
filter_value: MyString
|
||||
filter_criteria_id: 1
|
||||
|
||||
two:
|
||||
filter_text: MyString
|
||||
filter_value: MyString
|
||||
filter_criteria_id: 1
|
||||
7
back-office/test/models/filter_criteria_value_test.rb
Normal file
7
back-office/test/models/filter_criteria_value_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class FilterCriteriaValueTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/filter_criterium_test.rb
Normal file
7
back-office/test/models/filter_criterium_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class FilterCriteriumTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user