summaryrefslogtreecommitdiff
path: root/spec/services/projects/update_pages_configuration_service_spec.rb
blob: 8b329bc21c3fee4076da88d3a880c67ca61c7ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'spec_helper'

describe Projects::UpdatePagesConfigurationService, services: true do
  let(:project) { create(:empty_project) }
  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