Commit 3d22029c authored by Rémy Coutable's avatar Rémy Coutable

[EE] Reduce the diff with CE in spec/helpers/issuables_helper_spec.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent ee02b520
# frozen_string_literal: true
require 'spec_helper'
describe IssuablesHelper do
describe '#issuable_initial_data' do
let(:user) { create(:user) }
before do
allow(helper).to receive(:current_user).and_return(user)
allow(helper).to receive(:can?).and_return(true)
stub_commonmark_sourcepos_disabled
end
it 'returns the correct data that includes canAdmin: true' do
issue = create(:issue, author: user, description: 'issue text')
@project = issue.project
expect(helper.issuable_initial_data(issue)).to include(canAdmin: true)
end
end
end
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe IssuablesHelper do describe IssuablesHelper do
...@@ -185,7 +187,6 @@ describe IssuablesHelper do ...@@ -185,7 +187,6 @@ describe IssuablesHelper do
updateEndpoint: "/#{@project.full_path}/issues/#{issue.iid}.json", updateEndpoint: "/#{@project.full_path}/issues/#{issue.iid}.json",
canUpdate: true, canUpdate: true,
canDestroy: true, canDestroy: true,
canAdmin: true,
issuableRef: "##{issue.iid}", issuableRef: "##{issue.iid}",
markdownPreviewPath: "/#{@project.full_path}/preview_markdown", markdownPreviewPath: "/#{@project.full_path}/preview_markdown",
markdownDocsPath: '/help/user/markdown', markdownDocsPath: '/help/user/markdown',
...@@ -199,7 +200,7 @@ describe IssuablesHelper do ...@@ -199,7 +200,7 @@ describe IssuablesHelper do
initialDescriptionText: 'issue text', initialDescriptionText: 'issue text',
initialTaskStatus: '0 of 0 tasks completed' initialTaskStatus: '0 of 0 tasks completed'
} }
expect(helper.issuable_initial_data(issue)).to eq(expected_data) expect(helper.issuable_initial_data(issue)).to match(hash_including(expected_data))
end end
end end
end end
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