Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-11 15:39:23 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-12 12:36:54 +0300
commit8cde1e3285c870c85bee3a9a9ff4b8e5f53cff86 (patch)
tree207a39cabbbf48f5cf9e9cb17a01e55c09a3eae1 /spec/serializers
parentbd8943f5adfc377491bedb2a794d8c39b2b4c45e (diff)
Use polymorphism for common attributes in `GroupChildEntity`
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/group_child_entity_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/serializers/group_child_entity_spec.rb b/spec/serializers/group_child_entity_spec.rb
index 64000385781..452754d7a79 100644
--- a/spec/serializers/group_child_entity_spec.rb
+++ b/spec/serializers/group_child_entity_spec.rb
@@ -1,6 +1,8 @@
require 'spec_helper'
describe GroupChildEntity do
+ include Gitlab::Routing.url_helpers
+
let(:user) { create(:user) }
let(:request) { double('request') }
let(:entity) { described_class.new(object, request: request) }
@@ -24,7 +26,6 @@ describe GroupChildEntity do
type
can_edit
visibility
- edit_path
permission
relative_path].each do |attribute|
it "includes #{attribute}" do
@@ -51,6 +52,10 @@ describe GroupChildEntity do
expect(json[:star_count]).to be_present
end
+ it 'has the correct edit path' do
+ expect(json[:edit_path]).to eq(edit_project_path(object))
+ end
+
it_behaves_like 'group child json'
end
@@ -87,6 +92,10 @@ describe GroupChildEntity do
expect(json[:can_leave]).to be_truthy
end
+ it 'has the correct edit path' do
+ expect(json[:edit_path]).to eq(edit_group_path(object))
+ end
+
it_behaves_like 'group child json'
end
end