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-2.0.0 spec/features/index_table_spec.rb
releaf-core-1.1.22 spec/features/index_table_spec.rb
releaf-core-1.1.21 spec/features/index_table_spec.rb
releaf-core-1.1.20 spec/features/index_table_spec.rb
releaf-core-1.1.19 spec/features/index_table_spec.rb
releaf-core-1.1.18 spec/features/index_table_spec.rb
releaf-core-1.1.17 spec/features/index_table_spec.rb
releaf-core-1.1.16 spec/features/index_table_spec.rb
releaf-core-1.1.15 spec/features/index_table_spec.rb
releaf-core-1.1.14 spec/features/index_table_spec.rb
releaf-core-1.1.13 spec/features/index_table_spec.rb
releaf-core-1.1.12 spec/features/index_table_spec.rb
releaf-core-1.1.11 spec/features/index_table_spec.rb
releaf-core-1.1.10 spec/features/index_table_spec.rb
releaf-core-1.1.9 spec/features/index_table_spec.rb
releaf-core-1.1.8 spec/features/index_table_spec.rb
releaf-core-1.1.7 spec/features/index_table_spec.rb
releaf-core-1.1.6 spec/features/index_table_spec.rb
releaf-core-1.1.5 spec/features/index_table_spec.rb
releaf-core-1.1.4 spec/features/index_table_spec.rb