Sha256: 92c53b76f1c84965b6dee7af777e1efdee472d6a84fbe01b1fd65ddfd280c79c

Contents?: true

Size: 890 Bytes

Versions: 12

Compression:

Stored size: 890 Bytes

Contents

require "test_helper"

class Admin::StatusControllerTest < ActionController::TestCase

  context "Admin" do

    setup do
      @request.session[:typus_user_id] = Factory(:typus_user).id
    end

    should "render index" do
      get :index
      assert_response :success
      assert_template 'index'
    end

  end

  context "Editor" do

    setup do
      @request.session[:typus_user_id] = Factory(:typus_user, :role => "editor").id
    end

    should "not render index" do
      get :index
      assert_response :unprocessable_entity
    end

  end

  context "Not logged user" do

    setup do
      @request.session[:typus_user_id] = nil
    end

    should "not render index and redirect to new_admin_session_path with back_to" do
      get :index
      assert_response :redirect
      assert_redirected_to new_admin_session_path(:back_to => '/admin/status')
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
typus-3.0.2 test/functional/admin/status_controller_test.rb
typus-3.0.1 test/functional/admin/status_controller_test.rb
typus-3.0.0 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre13 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre12 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre11 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre10 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre9 test/functional/admin/status_controller_test.rb
typus-1.0.0.pre8 test/functional/admin/resources_controller_tableless_resource_test.rb
typus-1.0.0.pre7 test/functional/admin/resources_controller_tableless_resource_test.rb
typus-1.0.0.pre6 test/functional/admin/resources_controller_tableless_resource_test.rb
typus-1.0.0.pre5 test/functional/admin/resources_controller_tableless_resource_test.rb