Sha256: 7fd5f8842856d14759bc9d80c5c5988f1fe704462ee6cdf63c1476efe187507f

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe "Admin users feature." do

  describe 'signup user' do
    it "renders signup form" do
      visit admin_signup_path

      expect(page).to have_content('Please signup to edit your Website.')
      expect(page).to have_selector('#user_signup')
    end

    it "does not render tag list input" do
      visit admin_signup_path

      expect(page).not_to have_selector('.tag_list')
    end
  end

  context 'logged in as admin' do
    before { authorize_as_admin(create(:alchemy_admin_user)) }

    describe 'create new user' do
      it "has send_credentials checkbox activated" do
        visit new_admin_user_path

        expect(page).to have_selector 'input[type="checkbox"][checked="checked"][name="user[send_credentials]"]'
      end
    end

    describe 'edit existing user' do
      let(:user) { create(:alchemy_author_user) }

      it "has send_credentials checkbox deactivated" do
        visit edit_admin_user_path(id: user.id)

        expect(page).to have_selector 'input[type="checkbox"][name="user[send_credentials]"]'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alchemy-devise-2.1.0 spec/features/admin/users_feature_spec.rb
alchemy-devise-2.1.0.beta3 spec/features/admin/users_feature_spec.rb