Sha256: 1745aad07031409bfec6c5812ac140331a60e872bed097ffb299ab610bc1cdf3
Contents?: true
Size: 1.77 KB
Versions: 231
Compression:
Stored size: 1.77 KB
Contents
require 'spec_helper' describe HomeController do include ActionController::RecordIdentifier include SocialStream::TestHelpers render_views describe "create" do context "with logged user" do before do @user = Factory(:user) sign_in @user end context "to represent herself" do it "should redirect_to root" do get :index, :s => @user.slug assigns(:current_subject).should == @user response.should be_success end end context "to represent own group" do before do @group = Factory(:member, :contact => Factory(:group_contact, :receiver => @user.actor)).sender_subject end it "should redirect_to root" do get :index, :s => @group.slug assigns(:current_subject).should == @group response.should be_success end end context "representing own group" do before do @group = Factory(:member, :contact => Factory(:group_contact, :receiver => @user.actor)).sender_subject represent @group end context "to represent herself" do it "should redirect_to root" do get :index, :s => @user.slug assigns(:current_subject).should == @user response.should be_success end end end context "to represent other group" do before do @group = Factory(:group) end it "should deny access" do begin get :index, :s => @group.slug assert false rescue ActionView::Template::Error => e assert e.message == "Not authorized!" rescue CanCan::AccessDenied assert true end end end end end end
Version data entries
231 entries across 231 versions & 4 rubygems