[#37] cant -> can't
This commit is contained in:
parent
f65f8be060
commit
7498a99718
|
@ -61,7 +61,7 @@ describe Api::V1::IssuesController do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant show issue in hidden project' do
|
it "can't show issue in hidden project" do
|
||||||
get :show, :project_id => @hidden_project.id, :id => @hidden_issue.serial_id, :format => :json
|
get :show, :project_id => @hidden_project.id, :id => @hidden_issue.serial_id, :format => :json
|
||||||
response.status.should == 403
|
response.status.should == 403
|
||||||
end
|
end
|
||||||
|
@ -106,7 +106,7 @@ describe Api::V1::IssuesController do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant show issue in hidden project', :anonymous_access => true do
|
it "can't show issue in hidden project", :anonymous_access => true do
|
||||||
get :show, :project_id => @hidden_project.id, :id => @hidden_issue.serial_id, :format => :json
|
get :show, :project_id => @hidden_project.id, :id => @hidden_issue.serial_id, :format => :json
|
||||||
response.status.should == 403
|
response.status.should == 403
|
||||||
end
|
end
|
||||||
|
@ -136,7 +136,7 @@ describe Api::V1::IssuesController do
|
||||||
lambda { post :create, @create_params.merge(:project_id => @open_project.id)}.should change{ Issue.count }.by(1)
|
lambda { post :create, @create_params.merge(:project_id => @open_project.id)}.should change{ Issue.count }.by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant create issue in hidden project' do
|
it "can't create issue in hidden project" do
|
||||||
lambda { post :create, @create_params.merge(:project_id => @hidden_project.id)}.should change{ Issue.count }.by(0)
|
lambda { post :create, @create_params.merge(:project_id => @hidden_project.id)}.should change{ Issue.count }.by(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -145,18 +145,18 @@ describe Api::V1::IssuesController do
|
||||||
@project.issues.reload.last.assignee.id.should == @issue.user.id
|
@project.issues.reload.last.assignee.id.should == @issue.user.id
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant assignee issue in open project' do
|
it "can't assignee issue in open project" do
|
||||||
post :create, @create_params.deep_merge(:project_id => @open_project.id, :issue => {:assignee_id => @issue.user.id})
|
post :create, @create_params.deep_merge(:project_id => @open_project.id, :issue => {:assignee_id => @issue.user.id})
|
||||||
@open_project.issues.reload.last.assignee.should be_nil
|
@open_project.issues.reload.last.assignee.should be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for anonymous user' do
|
context 'for anonymous user' do
|
||||||
it 'cant create issue in project', :anonymous_access => true do
|
it "can't create issue in project", :anonymous_access => true do
|
||||||
lambda { post :create, @create_params}.should change{ Issue.count }.by(0)
|
lambda { post :create, @create_params}.should change{ Issue.count }.by(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant create issue in hidden project', :anonymous_access => true do
|
it "can't create issue in hidden project", :anonymous_access => true do
|
||||||
lambda { post :create, @create_params.merge(:project_id => @hidden_project.id)}.should change{ Issue.count }.by(0)
|
lambda { post :create, @create_params.merge(:project_id => @hidden_project.id)}.should change{ Issue.count }.by(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -178,17 +178,17 @@ describe Api::V1::IssuesController do
|
||||||
@own_hidden_issue.reload.title.should == 'new title'
|
@own_hidden_issue.reload.title.should == 'new title'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant update issue in open project' do
|
it "can't update issue in open project" do
|
||||||
put :update, @update_params.merge(:project_id => @open_project.id, :id => @open_issue.serial_id)
|
put :update, @update_params.merge(:project_id => @open_project.id, :id => @open_issue.serial_id)
|
||||||
@open_issue.reload.title.should_not == 'new title'
|
@open_issue.reload.title.should_not == 'new title'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant update issue in hidden project' do
|
it "can't update issue in hidden project" do
|
||||||
put :update, @update_params.merge(:project_id => @hidden_project.id, :id => @hidden_issue.serial_id)
|
put :update, @update_params.merge(:project_id => @hidden_project.id, :id => @hidden_issue.serial_id)
|
||||||
@hidden_issue.reload.title.should_not == 'title'
|
@hidden_issue.reload.title.should_not == 'title'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant assignee issue in open project' do
|
it "can't assignee issue in open project" do
|
||||||
post :create, @update_params.deep_merge(:project_id => @open_project.id, :issue => {:assignee_id => @issue.user.id})
|
post :create, @update_params.deep_merge(:project_id => @open_project.id, :issue => {:assignee_id => @issue.user.id})
|
||||||
@open_issue.reload.assignee.id.should_not == @issue.user.id
|
@open_issue.reload.assignee.id.should_not == @issue.user.id
|
||||||
end
|
end
|
||||||
|
@ -203,12 +203,12 @@ describe Api::V1::IssuesController do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@count = Issue.count
|
@count = Issue.count
|
||||||
end
|
end
|
||||||
it 'cant update issue in project', :anonymous_access => true do
|
it "can't update issue in project", :anonymous_access => true do
|
||||||
put :update, @update_params
|
put :update, @update_params
|
||||||
response.status.should == 401
|
response.status.should == 401
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'cant update issue in hidden project', :anonymous_access => true do
|
it "can't update issue in hidden project", :anonymous_access => true do
|
||||||
put :update, @update_params.merge(:project_id => @hidden_project.id, :id => @hidden_issue.serial_id)
|
put :update, @update_params.merge(:project_id => @hidden_project.id, :id => @hidden_issue.serial_id)
|
||||||
response.status.should == 401
|
response.status.should == 401
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue