Sha256: 0cd3e86c167173ca926c42ce196c084dd5fdb455e787bc453e5507580367b693

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

feature 'Promotions' do
  stub_authorization!

  context 'index' do
    context 'when no promotions' do
      scenario 'shows no promotions found message' do
        visit spree.admin_promotions_path
        expect(page).to have_content('No Promotions found.')
      end
    end

    context 'when promotion is active' do
      given!(:promotion) { create :promotion }

      scenario 'promotion status is active' do
        visit spree.admin_promotions_path

        within_row(1) do
          expect(column_text(3)).to eq("Active")
        end
      end
    end

    context 'when promotion is in the future' do
      given!(:promotion) { create :promotion, starts_at: 1.day.after }

      scenario 'promotion status is not started' do
        visit spree.admin_promotions_path

        within_row(1) do
          expect(column_text(3)).to eq("Not started")
        end
      end
    end

    context 'when promotion is in the past' do
      given!(:promotion) { create :promotion, expires_at: 1.day.ago }

      scenario 'promotion status is expired' do
        visit spree.admin_promotions_path

        within_row(1) do
          expect(column_text(3)).to eq("Expired")
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_backend-2.10.5 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.10.3 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.10.2 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.6 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.10.1 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.5 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.10.0 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.4 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.3 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.2 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.10.0.beta1 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.1 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.0 spec/features/admin/promotions/promotion_spec.rb
solidus_backend-2.9.0.rc.1 spec/features/admin/promotions/promotion_spec.rb