Sha256: 2fdbc80f59606c785a963bf93cc036fbceaae6f2527ba7fe6782b8ac26443dab

Contents?: true

Size: 922 Bytes

Versions: 6

Compression:

Stored size: 922 Bytes

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] }
          let(:user){ workflow.user 123 }
          before(:each){ pass_until workflow, is: :ready }
          
          it 'should add seen subjects' do
            async_workflow = double
            workflow.should_receive(:async).and_return async_workflow
            async_workflow.should_receive(:add_seen_for).with 123, 123
            put "/workflows/#{ workflow_type }/users/123/add_seen", subject_id: 123
            last_response.status.should == 200
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cellect-server-0.0.7 spec/server/api/add_seen_spec.rb
cellect-server-0.0.6 spec/server/api/add_seen_spec.rb
cellect-server-0.0.5 spec/server/api/add_seen_spec.rb
cellect-server-0.0.4 spec/server/api/add_seen_spec.rb
cellect-server-0.0.3 spec/server/api/add_seen_spec.rb
cellect-server-0.0.2 spec/server/api/add_seen_spec.rb