2017-01-26 20:58:42 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe Projects::UpdatePagesConfigurationService do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2017-01-26 20:58:42 -05:00
|
|
|
subject { described_class.new(project) }
|
|
|
|
|
|
|
|
describe "#update" do
|
|
|
|
let(:file) { Tempfile.new('pages-test') }
|
|
|
|
|
|
|
|
after do
|
|
|
|
file.close
|
|
|
|
file.unlink
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'updates the .update file' do
|
|
|
|
# Access this reference to ensure scoping works
|
|
|
|
Projects::Settings # rubocop:disable Lint/Void
|
|
|
|
expect(subject).to receive(:pages_config_file).and_return(file.path)
|
|
|
|
expect(subject).to receive(:reload_daemon).and_call_original
|
|
|
|
|
|
|
|
expect(subject.execute).to eq({ status: :success })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|