diff options
author | Nick Thomas <nick@gitlab.com> | 2016-11-11 15:51:50 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-11-11 18:45:47 +0300 |
commit | d211011698016bd4f04bc32e7450d6df470ea0c2 (patch) | |
tree | bf6a1309c933dbff7c1c16ee3ee6ee199d8bffbd /spec/requests/api/access_requests_spec.rb | |
parent | 64d2eff9ccf716395d101f2ac91db44c47d7394e (diff) |
Make access request specs explicitly enable or disable access requests as required
Diffstat (limited to 'spec/requests/api/access_requests_spec.rb')
-rw-r--r-- | spec/requests/api/access_requests_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/requests/api/access_requests_spec.rb b/spec/requests/api/access_requests_spec.rb index b467890a403..1a771b3c87a 100644 --- a/spec/requests/api/access_requests_spec.rb +++ b/spec/requests/api/access_requests_spec.rb @@ -9,19 +9,19 @@ describe API::AccessRequests, api: true do let(:stranger) { create(:user) } let(:project) do - project = create(:project, :public, creator_id: master.id, namespace: master.namespace) - project.team << [developer, :developer] - project.team << [master, :master] - project.request_access(access_requester) - project + create(:project, :public, :access_requestable, creator_id: master.id, namespace: master.namespace) do |project| + project.team << [developer, :developer] + project.team << [master, :master] + project.request_access(access_requester) + end end let(:group) do - group = create(:group, :public) - group.add_developer(developer) - group.add_owner(master) - group.request_access(access_requester) - group + create(:group, :public, :access_requestable) do |group| + group.add_developer(developer) + group.add_owner(master) + group.request_access(access_requester) + end end shared_examples 'GET /:sources/:id/access_requests' do |source_type| @@ -89,7 +89,7 @@ describe API::AccessRequests, api: true do context 'when authenticated as a stranger' do context "when access request is disabled for the #{source_type}" do before do - source.update(request_access_enabled: false) + source.update_attributes(request_access_enabled: false) end it 'returns 403' do |