Sha256: f3c295609ef5bd7eeae9c954f1a52188bc5aeaff27526678609e5c9f0fe74083

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

require 'rails_helper'

RSpec.describe 'Events Requests', folder: :requests do
  include_context 'loaded site'

  let(:valid_attributes) do
    { event: { name: 'Test Event', schedule_attributes: { date: Date.today, time: Time.zone.now } } }
  end

  let(:invalid_attributes) do
    { event: { name: nil } }
  end

  pending 'Browsing Events' do
    describe 'at /date_book/events' do
        describe 'without a query' do
          before do
            get '/date_book/events.json'
          end
          it_behaves_like(
            'a json object listing a collection of items',
            Event,
            minimum: 2
          )
        end
        describe 'with a query' do
          before do
            get(
              '/date_book/events.json',
              params: {
                start: Date.today
              }
            )
          end
          it_behaves_like(
            'a json object listing a collection of items',
            Event,
            minimum: 1
          )
        end
    end
  end

  pending 'Showing Events' do
    describe 'at /date_book/events/monday' do
      before do
        get '/date_book/events/monday.json'
      end
      it_behaves_like(
        'a json object showing an item',
        Event,
        'Monday'
      )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
date_book-0.0.6 spec/requests/date_book/events_spec.rb
date_book-0.0.5 spec/requests/date_book/events_spec.rb
date_book-0.0.3 spec/requests/date_book/events_spec.rb
date_book-0.0.2 spec/requests/date_book/events_spec.rb
date_book-0.0.1 spec/requests/date_book/events_spec.rb