Sha256: d2ae3ddba3ea9e33b8f729aadea64593bb421c076899a13633b0d14ec5fa28e1

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

require 'spec_helper'

feature 'Review Admin', js: true do
  stub_authorization!

  given!(:review) { create(:review) }

  context 'index' do
    background do
      visit spree.admin_reviews_path
    end

    scenario 'list reviews' do
      expect(page).to have_text review.product.name
    end

    scenario 'approve reviews' do
      expect(review.approved).to be false
      within("tr#review_#{review.id}") do
        find('.approve').click
      end
      expect(review.reload.approved).to be true
    end

    scenario 'edit reviews' do
      expect(page).to have_text review.product.name
      within("tr#review_#{review.id}") do
        find('.edit').click
      end

      expect(page).to have_text 'Editing'
      expect(page).to have_text review.title
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jiffyshirts_spree_reviews-2.3.1.2 spec/features/admin_spec.rb
jiffyshirts_spree_reviews-2.3.1.1 spec/features/admin_spec.rb