Sha256: b38ab4b36c960b45db5bac1dce947622f403e50d8ff2f265efe76b46a186850d

Contents?: true

Size: 1.43 KB

Versions: 33

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'

describe Admin::UsersController, "routes" do
  it { should route(:get, "/admin/users").to(:action => :index) }
  it { should route(:get, "/admin/users/123").to(:action => :show, :id => 123) }
end

describe Admin::UsersController, "get index without http auth" do
  before { get :index }
  it { should respond_with(:unauthorized) }
end

describe Admin::UsersController, "get index with http auth" do
  before do
    http_basic_auth_sign_in 'admin', 'admin'
    get :index
  end
  it { should respond_with(:success) }
  it { should render_template(:index) }
end

describe Admin::UsersController, "get search without http auth" do
  before { get :search }
  it { should respond_with(:unauthorized) }
end

describe Admin::UsersController, "get search with http auth" do
  before do
    http_basic_auth_sign_in 'admin', 'admin'
    get :search
  end
  it { should respond_with(:success) }
  it { should render_template(:index) }
end

describe Admin::UsersController, "get show without http auth" do
  let(:user) { Factory(:user) }
  before { get :show, :id => user.to_param }
  it { should respond_with(:unauthorized) }
end

describe Admin::UsersController, "get show with http auth" do
  let(:user) { Factory(:user) }
  before do
    http_basic_auth_sign_in 'admin', 'admin'
    get :show, :id => user.to_param
  end
  before { get :show, :id => user.to_param }
  it { should respond_with(:success) }
  it { should render_template(:show) }
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
saucy-0.16.1 spec/controllers/admin/users_controller_spec.rb
saucy-0.16.0 spec/controllers/admin/users_controller_spec.rb
saucy-0.15.2 spec/controllers/admin/users_controller_spec.rb
saucy-0.15.1 spec/controllers/admin/users_controller_spec.rb
saucy-0.15.0 spec/controllers/admin/users_controller_spec.rb
saucy-0.14.5 spec/controllers/admin/users_controller_spec.rb
saucy-0.14.3 spec/controllers/admin/users_controller_spec.rb
saucy-0.10.10 spec/controllers/admin/users_controller_spec.rb
saucy-0.14.2 spec/controllers/admin/users_controller_spec.rb
saucy-0.14.1 spec/controllers/admin/users_controller_spec.rb
saucy-0.14.0 spec/controllers/admin/users_controller_spec.rb
saucy-0.13.3 spec/controllers/admin/users_controller_spec.rb
saucy-0.13.2 spec/controllers/admin/users_controller_spec.rb
saucy-0.10.9 spec/controllers/admin/users_controller_spec.rb
saucy-0.10.8 spec/controllers/admin/users_controller_spec.rb
saucy-0.13.1 spec/controllers/admin/users_controller_spec.rb
saucy-0.13.0 spec/controllers/admin/users_controller_spec.rb
saucy-0.12.5 spec/controllers/admin/users_controller_spec.rb
saucy-0.12.4 spec/controllers/admin/users_controller_spec.rb
saucy-0.12.3 spec/controllers/admin/users_controller_spec.rb