Commit 0e10d148 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch '6121-extract-lines-wiki-pages-spec-ee' into 'master'

Update CE specific specs to match CE version

Closes #6121

See merge request gitlab-org/gitlab-ee!10637
parents 8e34ca57 4355ebde
......@@ -15,7 +15,7 @@ describe WikiPages::CreateService do
subject(:service) { described_class.new(project, user, opts) }
before do
project.add_maintainer(user)
project.add_developer(user)
end
describe '#execute' do
......@@ -23,11 +23,14 @@ describe WikiPages::CreateService do
page = service.execute
expect(page).to be_valid
expect(page).to have_attributes(title: opts[:title], content: opts[:content], format: opts[:format].to_sym)
expect(page.title).to eq(opts[:title])
expect(page.content).to eq(opts[:content])
expect(page.format).to eq(opts[:format].to_sym)
end
it 'executes webhooks' do
expect(service).to receive(:execute_hooks).once.with(instance_of(WikiPage), 'create')
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'create')
service.execute
end
......
......@@ -8,12 +8,13 @@ describe WikiPages::DestroyService do
subject(:service) { described_class.new(project, user) }
before do
project.add_maintainer(user)
project.add_developer(user)
end
describe '#execute' do
it 'executes webhooks' do
expect(service).to receive(:execute_hooks).once.with(instance_of(WikiPage), 'delete')
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'delete')
service.execute(page)
end
......
......@@ -17,7 +17,7 @@ describe WikiPages::UpdateService do
subject(:service) { described_class.new(project, user, opts) }
before do
project.add_maintainer(user)
project.add_developer(user)
end
describe '#execute' do
......@@ -25,13 +25,15 @@ describe WikiPages::UpdateService do
updated_page = service.execute(page)
expect(updated_page).to be_valid
expect(updated_page).to have_attributes(message: opts[:message], content: opts[:content], format: opts[:format].to_sym)
expect(updated_page.message).to eq(opts[:message])
expect(updated_page.content).to eq(opts[:content])
expect(updated_page.format).to eq(opts[:format].to_sym)
expect(updated_page.title).to eq(opts[:title])
end
it 'executes webhooks' do
expect(service).to receive(:execute_hooks).once.with(instance_of(WikiPage), 'update')
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'update')
service.execute(page)
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