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