Sha256: 1299d4150b213e0e0ebb71b940653e68fec26316ffc871b0c78a0f4611c4311c

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

module Cellect::Server
  describe API do
    include_context 'API'

    { 'Ungrouped' => nil, 'Grouped' => 'grouped' }.each_pair do |grouping_type, grouping|
      SET_TYPES.shuffle.each do |set_type|
        context "#{ grouping_type } #{ set_type }" do
          let(:workflow_type){ [grouping, set_type].compact.join '_' }
          let(:workflow){ Workflow[workflow_type] }
          before(:each){ pass_until_state_of workflow, is: :ready }

          it 'should load users' do
            async_workflow = double
            expect(workflow).to receive(:async).and_return async_workflow
            expect(async_workflow).to receive(:user).with 123
            post "/workflows/#{ workflow_type }/users/123/load"
            expect(last_response.status).to eq 201
          end
        end
      end
    end

    it 'should handle missing workflows' do
      allow(Workflow).to receive(:[]).with('missing').and_return nil
      post '/workflows/missing/users/123/load'
      expect(last_response.status).to eql 404
      expect(last_response.body).to match /Not Found/
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cellect-server-3.0.2 spec/cellect/server/api/user_load_spec.rb
cellect-server-3.0.1 spec/cellect/server/api/user_load_spec.rb
cellect-server-3.0.0 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.1.1 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.1.0 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.1 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.0 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.0.beta4 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.0.beta3 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.0.beta2 spec/cellect/server/api/user_load_spec.rb
cellect-server-2.0.0.beta1 spec/cellect/server/api/user_load_spec.rb
cellect-server-1.3.3 spec/server/api/user_load_spec.rb
cellect-server-1.3.2 spec/server/api/user_load_spec.rb