Sha256: de4782063cf4bb63b4486d3a89066ae8374d46c986f892b5f4f83e286107721d

Contents?: true

Size: 1.15 KB

Versions: 32

Compression:

Stored size: 1.15 KB

Contents

require 'rails_helper'
feature "Index tables" do
  background do
    auth_as_user
    publisher = create(:publisher, title: "ABC books")
    author = create(:author, publisher: publisher)
    another_author = create(:author, name: "Steve", publisher: nil)
    @book_1 = create(:book, title: "good book", author: author)
    @book_2 = create(:book, title: "steevs book", author: another_author)
  end

  scenario "shows books author publisher title" do
    visit admin_books_path

    within ".table.books thead tr" do
      cells = [
        "Title", "Year", "Author", "Genre", "Active", "Published at",
        "Price", "Stars", "Description", "Author publisher title"
      ]
      expect(page).to have_cells_text(cells, type: "th")
    end

    within ".table.books tbody" do
      within "tr[data-id='#{@book_1.id}']" do
        cells = ["good book", "", "Aleksandrs Lielais", "", "", "No", "", "", "", "ABC books"]
        expect(page).to have_cells_text(cells)
      end

      within "tr[data-id='#{@book_2.id}']" do
        cells = ["steevs book", "", "Steve Lielais", "", "", "No", "", "", "", ""]
        expect(page).to have_cells_text(cells)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
releaf-core-1.1.3 spec/features/index_table_spec.rb
releaf-core-1.1.2 spec/features/index_table_spec.rb
releaf-core-1.1.1 spec/features/index_table_spec.rb
releaf-core-1.1.0 spec/features/index_table_spec.rb
releaf-core-1.0.10 spec/features/index_table_spec.rb
releaf-core-1.0.9 spec/features/index_table_spec.rb
releaf-core-1.0.8 spec/features/index_table_spec.rb
releaf-core-1.0.7 spec/features/index_table_spec.rb
releaf-core-1.0.6 spec/features/index_table_spec.rb
releaf-core-1.0.5 spec/features/index_table_spec.rb
releaf-core-1.0.4 spec/features/index_table_spec.rb
releaf-core-1.0.3 spec/features/index_table_spec.rb