diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-11 14:39:23 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-12 11:36:54 +0200 |
commit | 8cde1e3285c870c85bee3a9a9ff4b8e5f53cff86 (patch) | |
tree | 207a39cabbbf48f5cf9e9cb17a01e55c09a3eae1 /spec/serializers | |
parent | bd8943f5adfc377491bedb2a794d8c39b2b4c45e (diff) | |
download | gitlab-ce-8cde1e3285c870c85bee3a9a9ff4b8e5f53cff86.tar.gz |
Use polymorphism for common attributes in `GroupChildEntity`
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/group_child_entity_spec.rb | 11 |
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 |