Sha256: a4c3bc8b7a22f0244810634c9b8d61a68593e8954043434fb11d814aa6d84d9c

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

# encoding: utf-8
require 'acceptance_helper'

describe 'On the page /custom_ordering_with_arel with custom_ordering in controler with Arel WiceGrid', type: :request, js: true do
  before :each do
    visit '/custom_ordering_with_arel'
  end

  context 'when "statuses.name" => Arel.sql("length( ? )")' do
    it 'sorts by the length of the word' do
      within 'div#grid.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
        expect(page).to have_content('New')
      end

      within 'div#grid.wice-grid-container table.wice-grid thead' do
        click_on 'Status Name'
      end

      within 'div#grid.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
        expect(page).to have_content('Duplicate')
      end
    end
  end

  context 'when "statuses.name" => Status.arel_table[:position]' do
    it 'sorts by the position of the status' do
      within 'div#g2.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
        expect(page).to have_content('New')
      end

      within 'div#g2.wice-grid-container table.wice-grid thead' do
        click_on 'Status Name'
      end

      within 'div#g2.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
        expect(page).to have_content('Verified')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wice_grid-7.1.4 spec/features/custom_ordering_with_arel_request_spec.rb
wice_grid-7.1.3 spec/features/custom_ordering_with_arel_request_spec.rb
wice_grid-7.1.2 spec/features/custom_ordering_with_arel_request_spec.rb
wice_grid-7.1.1 spec/features/custom_ordering_with_arel_request_spec.rb
wice_grid-7.1.0 spec/features/custom_ordering_with_arel_request_spec.rb