Sha256: 67b314eadc9fd8b8f23713b80f6ec75672ff3625bc5c26b1015b8e61ac1d3e4b

Contents?: true

Size: 956 Bytes

Versions: 2

Compression:

Stored size: 956 Bytes

Contents

require 'spec_helper'

describe 'General Settings', type: :feature do

  # login into admin page
  before do
    @admin = Spree.user_class.create(email: 'admin@admin.com', password: 'password', password_confirmation: 'password')
    @role = Spree::Role.create(name: 'admin')
    @role.users << @admin
    sign_in_admin! @admin
  end

  context 'user registration settings' do
    it 'should show the attribute sms permission', js: true do
      visit spree.edit_admin_general_settings_path

      expect(page).to have_text Spree.t(:user_registration_settings)
      expect(page).to have_selector '#sms_permission'
    end

    it 'should possible check/uncheck the sms permission', js: true do
      visit spree.edit_admin_general_settings_path

      find(:css, '#sms_permission').set false

      click_button 'Update'

      expect(Spree::Config.sms_permission).to be(false)
      expect(find_field('sms_permission')).not_to be_checked
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_zaez_brazilian_fields-3.1.0 spec/features/admin/general_settings_spec.rb
spree_zaez_brazilian_fields-3.0.1 spec/features/admin/general_settings_spec.rb