Sha256: 42d1117f22f5dae4eff5b61953f298b8558df5e4caadbfbf6ecfbead2694d0bb

Contents?: true

Size: 1005 Bytes

Versions: 6

Compression:

Stored size: 1005 Bytes

Contents

shared_examples_for 'loader' do |name|
  let(:fixtures) do
    Cellect::Server
      .adapter
      .fixtures
      .fetch(workflow.name, { })
      .fetch('entries', [])
  end
  let(:fixture_count) { fixtures.count }

  describe "#load_data" do
    it "should use the server adapter to load data" do
      expect(Cellect::Server.adapter)
        .to receive(:load_data_for)
        .with(workflow.name)
        .and_call_original
      loader.load_data
    end

    it "should mark the workflow as loaded" do
      expect { loader.load_data }.to change { workflow.state }.to(:ready)
    end
  end

  describe "#reload_data" do
    it "should replace the existing subjects with the reloaded set" do
      expect {
        loader.reload_data(subjects)
      }.to change {
        workflow.subjects
      }.to(subjects)
    end

    it "should mark the workflow as ready" do
      expect {
        loader.reload_data(subjects)
      }.to change {
        workflow.state
      }.to(:ready)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
cellect-client-3.0.2 spec/support/shared_examples_for_loader.rb
cellect-server-3.0.2 spec/support/shared_examples_for_loader.rb
cellect-client-3.0.1 spec/support/shared_examples_for_loader.rb
cellect-server-3.0.1 spec/support/shared_examples_for_loader.rb
cellect-client-3.0.0 spec/support/shared_examples_for_loader.rb
cellect-server-3.0.0 spec/support/shared_examples_for_loader.rb