Sha256: f233177b728233105768b96413c10244b70bcc7b52f0cab354117ee4cadb14b3

Contents?: true

Size: 953 Bytes

Versions: 8

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

describe PasswordComponent do

  include RSpec::Rails::RequestExampleGroup

  context 'form' do

    it 'should render form field' do
      @user = Fabricate :user
      get admin_users_path

      field = controller.form_fields[:password]
      component = ''
      controller.view_context.form_for @user, :url => admin_user_path(@user) do |form|
        component = Puffer::Component::Base.render_component(controller, field, :form, :form => form)
      end

      component.should have_selector('label[for=user_password]')
      component.should have_selector("input[type=password]")
    end

  end

  context 'index' do

    it 'should render field content' do
      @user = Fabricate :user
      get admin_users_path

      field = controller.index_fields[:password]
      Puffer::Component::Base.render_component(controller, field, :index, :record => @user).should == '*' * @user.password.mb_chars.length
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puffer-0.0.32 spec/app/components/password_component_spec.rb
puffer-0.0.31 spec/app/components/password_component_spec.rb
puffer-0.0.30 spec/app/components/password_component_spec.rb
puffer-0.0.29 spec/app/components/password_component_spec.rb
puffer-0.0.28 spec/app/components/password_component_spec.rb
puffer-0.0.26 spec/app/components/password_component_spec.rb
puffer-0.0.25 spec/app/components/password_component_spec.rb
puffer-0.0.24 spec/app/components/password_component_spec.rb