docbrown/spec/system/collections/user_views_collection_articles_spec.rb
Alberto Pérez de Rada Fiol 115adbb1bd
[deploy] Add index and show pages for series (#9201)
* Add index and show pages for series

* Address code review

* Use `id` instead of `slug` to get collections

* Extract `collection_link` into the application helper

* Only count published articles

* Get rid of the `collection_link_class` method

* Add tests

* Fix test

* Use `**kwargs` instead of `options = {}`
2020-07-29 10:01:52 -04:00

17 lines
406 B
Ruby

require "rails_helper"
RSpec.describe "Viewing a collection", type: :system do
let(:user) { create(:user) }
let(:collection) { create(:collection, :with_articles, user: user) }
before do
sign_in user
visit collection.path
end
it "shows all published articles" do
collection.articles.published.each do |article|
expect(page.body).to have_link(article.title)
end
end
end