Sha256: 19857a658ed5f7b4f92f6386b1210e843d31a5461ee46c936fbbca2ab021f62c

Contents?: true

Size: 851 Bytes

Versions: 6

Compression:

Stored size: 851 Bytes

Contents

require_relative '../spec_helper'

describe Commands::Activity::Get do
  is_required :id, :application_id

  let(:response) { subject.class.run(params) }
  let(:params) { {} }

  before do
    @activity = ActivityFactory.create({ application_id: 100, title: 'test activity' })
  end

  context 'with valid params' do
    let(:params) { {
      id: @activity[:id],
      application_id: @activity[:application_id]
    } }

    it 'returns the correct activity' do
      response.success?.should == true
      response.result.should == @activity
    end
  end

  context 'with invalid :id' do
    let(:params) { {
      id: 142857,
      application_id: @activity[:application_id]
    }}

    it 'is unsuccessful' do
      response.success?.should == false
      response.result.should == {}
      response.status.should == :not_found
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
restpack_activity_service-0.0.12 spec/services/get_spec.rb
restpack_activity_service-0.0.11 spec/services/get_spec.rb
restpack_activity_service-0.0.10 spec/services/get_spec.rb
restpack_activity_service-0.0.9 spec/services/get_spec.rb
restpack_activity_service-0.0.8 spec/services/get_spec.rb
restpack_activity_service-0.0.7 spec/services/get_spec.rb