Sha256: 335f08441ee55ae031df161e10edec4093b1d35bfbe1aa2f76f36fbaca457067

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe 'Analytics Tracker', type: :feature do
  stub_authorization!

  context 'index' do
    before(:each) do
      create(:tracker)
      create(:tracker, analytics_id: 'A200')
      visit spree.admin_trackers_path
    end

    it 'should have the right content' do
      expect(page).to have_content('Analytics Trackers')
    end

    it 'should have the right tabular values displayed' do
      within_row(1) do
        expect(column_text(1)).to eq('A100')
        expect(column_text(2)).to eq('Google analytics')
        expect(column_text(3)).to eq('Yes')
      end

      within_row(2) do
        expect(column_text(1)).to eq('A200')
        expect(column_text(2)).to eq('Google analytics')
        expect(column_text(3)).to eq('Yes')
      end
    end
  end

  context 'create' do
    before(:each) do
      visit spree.admin_trackers_path
    end

    it 'should be able to create a new analytics tracker' do
      click_link 'admin_new_tracker_link'
      fill_in 'tracker_analytics_id', with: 'A100'
      click_button 'Create'

      expect(page).to have_content('successfully created!')
      within_row(1) do
        expect(column_text(1)).to eq('A100')
        expect(column_text(2)).to eq('Google analytics')
        expect(column_text(3)).to eq('Yes')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_analytics_trackers-1.1.0 spec/features/admin/configuration/analytics_tracker_spec.rb
spree_analytics_trackers-1.0.1 spec/features/admin/configuration/analytics_tracker_spec.rb