Sha256: 35c240900805c46854acc7f1d6a9f91bf9b42e6e80601250f183111e62ee8564

Contents?: true

Size: 1012 Bytes

Versions: 14

Compression:

Stored size: 1012 Bytes

Contents

require 'spec_helper'

describe "RailsAdmin Namespaced Model New" do

  subject { page }

  describe "AbstractModel#to_param" do
    it 'turns namespaces into prefixes with ~' do
      RailsAdmin::AbstractModel.new("Cms::BasicPage").to_param.should == 'cms~basic_page'
    end
  end

  describe "ApplicationController#to_model_name" do
    it 'turns cms~basic_page into Cms::BasicPage' do
      RailsAdmin::ApplicationController.new.to_model_name('cms~basic_page').should == 'Cms::BasicPage'
    end
  end

  describe "GET /admin/cms_basic_page/new" do
    before(:each) do
      visit new_path(:model_name => "cms~basic_page")
    end

    it 'should have correct input field names' do
      should have_selector("label[for=cms_basic_page_title]")
      should have_selector("input#cms_basic_page_title[name='cms_basic_page[title]']")
      should have_selector("label[for=cms_basic_page_content]")
      should have_selector("textarea#cms_basic_page_content[name='cms_basic_page[content]']")
    end
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
rails_admin-0.1.1 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.1.0 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.0.5 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.0.4 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.0.3 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.0.2 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
upstream-rails_admin-1.0.2 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
rails_admin-0.0.1 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
obitum-rails_admin-0.0.5 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
drewda_rails_admin-0.0.1 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
obitum-rails_admin-0.0.4 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
obitum-rails_admin-0.0.3 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
obitum-rails_admin-0.0.2 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
obitum-rails_admin-0.0.1 spec/requests/basic/new/rails_admin_namespaced_model_new_spec.rb