Commit c9ed33fd authored by raju249's avatar raju249

Use project creator as user instead of admin

parent 5ee3b284
...@@ -4,19 +4,17 @@ require 'spec_helper' ...@@ -4,19 +4,17 @@ require 'spec_helper'
describe API::ErrorTracking do describe API::ErrorTracking do
describe "GET sentry project settings" do describe "GET sentry project settings" do
let(:admin) { create(:admin) }
let(:project_not_found_message) { "404 Project Not Found" } let(:project_not_found_message) { "404 Project Not Found" }
let(:unauthorized_message) { "401 Unauthorized" } let(:unauthorized_message) { "401 Unauthorized" }
let(:random_user) { create(:user) } let(:random_user) { create(:user) }
let(:project_error_tracking_setting) { create(:project_error_tracking_setting) } let(:project_error_tracking_setting) { create(:project_error_tracking_setting) }
let(:project) do let(:project) do
create(:project, :repository, creator: admin, create(:project, :repository, error_tracking_setting: project_error_tracking_setting)
namespace: admin.namespace, error_tracking_setting: project_error_tracking_setting)
end end
context 'when user has permission to view settings' do context 'when user has permission to view settings' do
it 'returns 200' do it 'returns 200' do
get api("/projects/#{project.id}/error_tracking/sentry_project_settings", admin) get api("/projects/#{project.id}/error_tracking/sentry_project_settings", project.creator)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response["project_name"]).to eq(project_error_tracking_setting.project_name) expect(json_response["project_name"]).to eq(project_error_tracking_setting.project_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment