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