Sha256: 73ddd2e771f065ceb32f95f101e164fa693a35182c6ea840b8b17e423523403f

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

require 'spec_helper'

module KnowledgeBase
  describe ArticlesController do
    routes { KnowledgeBase::Engine.routes }

    describe "GET 'index'" do
      let!(:articles) { create_list :article, 3, :published }

      it "returns http success" do
        get :index

        articles = assigns :articles

        expect(response).to be_success
        expect(articles.count).to eq 3
      end
    end

    describe "GET 'show'" do
      it "returns http success" do
        article = create :article, :published

        get :show, id: article.slug

        response.should be_success
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knowledge_base-0.2.0 spec/controllers/knowledge_base/articles_controller_spec.rb