Commit 3275a767 authored by Nick Thomas's avatar Nick Thomas

Fix merge conflicts in WikiPages::{Create,Destroy,Update}Service specs

parent bd71a053
...@@ -2,11 +2,7 @@ require 'spec_helper' ...@@ -2,11 +2,7 @@ require 'spec_helper'
describe WikiPages::CreateService, services: true do describe WikiPages::CreateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
<<<<<<< HEAD
let(:user) { create(:user) }
=======
let(:user) { create(:user) } let(:user) { create(:user) }
>>>>>>> master
let(:opts) do let(:opts) do
{ {
...@@ -19,11 +15,7 @@ describe WikiPages::CreateService, services: true do ...@@ -19,11 +15,7 @@ describe WikiPages::CreateService, services: true do
subject(:service) { described_class.new(project, user, opts) } subject(:service) { described_class.new(project, user, opts) }
before do before do
<<<<<<< HEAD
project.add_developer(user)
=======
project.add_master(user) project.add_master(user)
>>>>>>> master
end end
describe '#execute' do describe '#execute' do
...@@ -31,22 +23,11 @@ describe WikiPages::CreateService, services: true do ...@@ -31,22 +23,11 @@ describe WikiPages::CreateService, services: true do
page = service.execute page = service.execute
expect(page).to be_valid expect(page).to be_valid
<<<<<<< HEAD
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(page).to have_attributes(title: opts[:title], content: opts[:content], format: opts[:format].to_sym) expect(page).to have_attributes(title: opts[:title], content: opts[:content], format: opts[:format].to_sym)
end end
it 'executes webhooks' do 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')
>>>>>>> master
service.execute service.execute
end end
......
...@@ -2,32 +2,18 @@ require 'spec_helper' ...@@ -2,32 +2,18 @@ require 'spec_helper'
describe WikiPages::DestroyService, services: true do describe WikiPages::DestroyService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
<<<<<<< HEAD
let(:user) { create(:user) }
let(:page) { create(:wiki_page) }
=======
let(:user) { create(:user) } let(:user) { create(:user) }
let(:page) { create(:wiki_page) } let(:page) { create(:wiki_page) }
>>>>>>> master
subject(:service) { described_class.new(project, user) } subject(:service) { described_class.new(project, user) }
before do before do
<<<<<<< HEAD
project.add_developer(user)
=======
project.add_master(user) project.add_master(user)
>>>>>>> master
end end
describe '#execute' do describe '#execute' do
it 'executes webhooks' do it 'executes webhooks' do
<<<<<<< HEAD
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'delete')
=======
expect(service).to receive(:execute_hooks).once.with(instance_of(WikiPage), 'delete') expect(service).to receive(:execute_hooks).once.with(instance_of(WikiPage), 'delete')
>>>>>>> master
service.execute(page) service.execute(page)
end end
......
...@@ -2,13 +2,8 @@ require 'spec_helper' ...@@ -2,13 +2,8 @@ require 'spec_helper'
describe WikiPages::UpdateService, services: true do describe WikiPages::UpdateService, services: true do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
<<<<<<< HEAD
let(:user) { create(:user) }
let(:page) { create(:wiki_page) }
=======
let(:user) { create(:user) } let(:user) { create(:user) }
let(:page) { create(:wiki_page) } let(:page) { create(:wiki_page) }
>>>>>>> master
let(:opts) do let(:opts) do
{ {
...@@ -21,11 +16,7 @@ describe WikiPages::UpdateService, services: true do ...@@ -21,11 +16,7 @@ describe WikiPages::UpdateService, services: true do
subject(:service) { described_class.new(project, user, opts) } subject(:service) { described_class.new(project, user, opts) }
before do before do
<<<<<<< HEAD
project.add_developer(user)
=======
project.add_master(user) project.add_master(user)
>>>>>>> master
end end
describe '#execute' do describe '#execute' do
...@@ -33,22 +24,11 @@ describe WikiPages::UpdateService, services: true do ...@@ -33,22 +24,11 @@ describe WikiPages::UpdateService, services: true do
updated_page = service.execute(page) updated_page = service.execute(page)
expect(updated_page).to be_valid expect(updated_page).to be_valid
<<<<<<< HEAD
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)
end
it 'executes webhooks' do
expect(service).to receive(:execute_hooks).once
.with(instance_of(WikiPage), 'update')
=======
expect(updated_page).to have_attributes(message: opts[:message], content: opts[:content], format: opts[:format].to_sym) expect(updated_page).to have_attributes(message: opts[:message], content: opts[:content], format: opts[:format].to_sym)
end end
it 'executes webhooks' do 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')
>>>>>>> master
service.execute(page) service.execute(page)
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