Sha256: 1f23c0f7988fdc168561752e71928f99d90bcaece61551783ff1138375dfd2b3

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

# -*- encoding : utf-8 -*-
require 'test_helper'

class Odania::TagsControllerTest < ActionController::TestCase
	def setup
		@site = create(:default_site)
		@request.host = @site.host
		@content = create(:content, site: @site, language: @site.default_language)
		@menu = create(:menu_with_items, site: @site, amount: 1, language: @site.default_language)
	end

	test 'test should render tag list' do
		get :index, {locale: @content.language.iso_639_1}
		assert_response :success
		assert_template :index
	end

	test 'test should render existing tag' do
		menu_item = @menu.menu_items.first
		menu_item.target_type = 'CONTENT'
		menu_item.target_data = {'id' => @content.id}
		menu_item.save!

		@content.body = 'This is a #ABC-Tag test'
		@content.save!

		get :show, {locale: @content.language.iso_639_1, tag: 'ABC-Tag'}
		assert_response :success
	end

	test 'test should render not found on invalid tag' do
		get :show, {tag: 'ABC', locale: @content.language.iso_639_1}
		assert_response :not_found
		assert_template 'odania/common/not_found_error'
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
odania_core-0.0.7 test/controllers/odania/tags_controller_test.rb
odania_core-0.0.6 test/controllers/odania/tags_controller_test.rb
odania_core-0.0.5 test/controllers/odania/tags_controller_test.rb
odania_core-0.0.4 test/controllers/odania/tags_controller_test.rb