Sha256: 1f160bb9f9873a0bb0afb2d0a1be92897a93e0d6219f171e297a6fb998d49888

Contents?: true

Size: 630 Bytes

Versions: 2

Compression:

Stored size: 630 Bytes

Contents

require 'spec_helper'

module Feeder
  describe FeedsController do
    routes { Feeder::Engine.routes }

    describe "GET 'index'" do
      let!(:items) do
        10.times.map do
          m = Message.create header: 'Header', body: 'Body'
          Item.create feedable: m, published_at: Time.zone.now
        end.sort_by(&:published_at).reverse
      end

      it "returns http success" do
        get :index
        expect(response).to be_successful
      end

      it "fetches feed items ordered by publiction date, descending" do
        get :index
        expect(assigns(:items)).to eq items
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
feeder-0.3.0 spec/controllers/feeder/feeds_controller_spec.rb
feeder-0.2.0 spec/controllers/feeder/feeds_controller_spec.rb