Sha256: db31ec5206d48a329b84468f5c49b1ae2eca3f26178f0f9800cae8a0a7aa9698

Contents?: true

Size: 649 Bytes

Versions: 8

Compression:

Stored size: 649 Bytes

Contents

# These is a workaround to test the functionality in a "normal way". It still feels a bit hacky and there might be a better way to test it.
class TestController < ApplicationController
	before_filter :authenticate_user!, only: [:test_authorized]
	before_filter :valid_site!, only: [:test_valid_site]

	def test_signed_in
		render :text => user_signed_in?
	end

	def test_current_user
		render :text => current_user
	end

	def test_authorized
		render :text => 'ok'
	end

	def test_current_site
		render :text => current_site.to_json(only: ['host', 'is_active'])
	end

	def test_valid_site
		render :text => 'ok'
	end

	def test_view_helper
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
odania_core-0.0.8 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.7 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.6 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.5 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.4 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.3 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.2 test/dummy/app/controllers/test_controller.rb
odania_core-0.0.1 test/dummy/app/controllers/test_controller.rb