Sha256: 40b9b48a661969379c3df70ffa6086b50a68e00d845ac06a8c6c4ef2066784f4

Contents?: true

Size: 1.33 KB

Versions: 6

Compression:

Stored size: 1.33 KB

Contents

require File.dirname(__FILE__) + '/../../test_helper'

class Admin::Muck::UsersControllerTest < ActionController::TestCase

  tests Admin::Muck::UsersController

  should_require_login :index => :get, :inactive => :get, :inactive_emails => :get, :activate_all => :get, :search => :get, :login_url => '/login'
  
  #:enable => :get, :disable => :get, :update => :post
  #should_require_role(:admin, '/login', :index)
  
  context "logged in as admin" do
    setup do
      @admin = Factory(:user)
      @admin_role = Factory(:role, :rolename => 'administrator')
      @admin.roles << @admin_role
      activate_authlogic
      login_as @admin
    end
    
    context "GET index" do
      setup do
        get :index
      end
      should_respond_with :success
      should_render_template :index
    end

    context "GET inactive" do
      setup do
        get :inactive
      end
      should_respond_with :success
      should_render_template :inactive
    end
    
    context "GET search" do
      setup do
        get :search
      end
      should_respond_with :success
      should_render_template :search
    end
    
    context 'on DELETE to :destroy' do
      setup do
        @user = Factory(:user)
        delete :destroy, {:id => @user.to_param}
      end
      should_redirect_to("Main user screen") { admin_users_path }
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
muck-users-0.1.4 test/rails_root/test/functional/admin/users_controller_test.rb
muck-users-0.1.5 test/rails_root/test/functional/admin/users_controller_test.rb
muck-users-0.1.0 test/functional/admin/users_controller_test.rb
muck-users-0.1.1 test/functional/admin/users_controller_test.rb
muck-users-0.1.2 test/functional/admin/users_controller_test.rb
muck-users-0.1.3 test/functional/admin/users_controller_test.rb