Permalink
Browse files

Use double quotes consistently in specs

  • Loading branch information...
sferik committed Oct 10, 2012
1 parent bbec534 commit e2a706061444b6626ebb5534c49c3df68916ceb8
Showing with 165 additions and 165 deletions.
  1. +3 −3 spec/controllers/main_controller_spec.rb
  2. +21 −21 spec/helpers/application_helper_spec.rb
  3. +4 −4 spec/helpers/form_builder_spec.rb
  4. +3 −3 spec/integration/authorization/cancan_spec.rb
  5. +2 −2 spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb
  6. +1 −1 spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb
  7. +3 −3 spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb
  8. +1 −1 spec/integration/basic/edit/rails_admin_basic_edit_spec.rb
  9. +3 −3 spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
  10. +12 −12 spec/integration/config/edit/rails_admin_config_edit_spec.rb
  11. +4 −4 spec/integration/config/list/rails_admin_config_list_spec.rb
  12. +7 −7 spec/integration/config/show/rails_admin_config_show_spec.rb
  13. +2 −2 spec/integration/history/rails_admin_history_spec.rb
  14. +4 −4 spec/integration/rails_admin_spec.rb
  15. +7 −7 spec/integration/relation_spec.rb
  16. +5 −5 spec/unit/abstract_model_spec.rb
  17. +2 −2 spec/unit/active_record_extension_spec.rb
  18. +2 −2 spec/unit/adapters/active_record/abstract_object_spec.rb
  19. +6 −6 spec/unit/adapters/active_record_spec.rb
  20. +1 −1 spec/unit/adapters/mongoid/abstract_object_spec.rb
  21. +6 −6 spec/unit/adapters/mongoid_spec.rb
  22. +2 −2 spec/unit/config/actions/base_spec.rb
  23. +16 −16 spec/unit/config/actions_spec.rb
  24. +38 −38 spec/unit/config/fields/base_spec.rb
  25. +2 −2 spec/unit/config/sections_spec.rb
  26. +8 −8 spec/unit/config_spec.rb
@@ -38,12 +38,12 @@
end
describe "#get_sort_hash" do
- it 'should work with belongs_to associations with label method virtual' do
+ it "should work with belongs_to associations with label method virtual" do
controller.params = { :sort => "parent_category", :model_name =>"categories" }
expect(controller.send(:get_sort_hash, RailsAdmin.config(Category))).to eq({:sort=>"categories.parent_category_id", :sort_reverse=>true})
end
- it 'should work with belongs_to associations with label method real column' do
+ it "should work with belongs_to associations with label method real column" do
controller.params = { :sort => "team", :model_name =>"players" }
expect(controller.send(:get_sort_hash, RailsAdmin.config(Player))).to eq({:sort=>"teams.name", :sort_reverse=>true})
end
@@ -174,7 +174,7 @@ class TeamWithNumberedPlayers < Team
end
describe "sanitize_params_for!" do
- it 'sanitize params recursively in nested forms' do
+ it "sanitize params recursively in nested forms" do
RailsAdmin.config Comment do
configure :created_at do
show
@@ -6,17 +6,17 @@
controller.stub(:authorized?).and_return(true)
end
- describe '#current_action?' do
- it 'should return true if current_action, false otherwise' do
+ describe "#current_action?" do
+ it "should return true if current_action, false otherwise" do
@action = RailsAdmin::Config::Actions.find(:index)
expect(helper.current_action?(RailsAdmin::Config::Actions.find(:index))).to be_true
expect(helper.current_action?(RailsAdmin::Config::Actions.find(:show))).not_to be_true
end
end
- describe '#action' do
- it 'should return action by :custom_key' do
+ describe "#action" do
+ it "should return action by :custom_key" do
RailsAdmin.config do |config|
config.actions do
dashboard do
@@ -27,7 +27,7 @@
expect(helper.action(:my_custom_dashboard_key)).to be
end
- it 'should return only visible actions' do
+ it "should return only visible actions" do
RailsAdmin.config do |config|
config.actions do
dashboard do
@@ -39,7 +39,7 @@
expect(helper.action(:dashboard)).to be_nil
end
- it 'should return only visible actions, passing all bindings' do
+ it "should return only visible actions, passing all bindings" do
RailsAdmin.config do |config|
config.actions do
member :test_bindings do
@@ -58,7 +58,7 @@
end
describe "#actions" do
- it 'should return actions by type' do
+ it "should return actions by type" do
abstract_model = RailsAdmin::AbstractModel.new(Player)
object = FactoryGirl.create :player
expect(helper.actions(:all, abstract_model, object).map(&:custom_key)).to eq([:dashboard, :index, :show, :new, :edit, :export, :delete, :bulk_delete, :history_show, :history_index, :show_in_app])
@@ -67,7 +67,7 @@
expect(helper.actions(:member, abstract_model, object).map(&:custom_key)).to eq([:show, :edit, :delete, :history_show, :show_in_app])
end
- it 'should only return visible actions, passing bindings correctly' do
+ it "should only return visible actions, passing bindings correctly" do
RailsAdmin.config do |config|
config.actions do
member :test_bindings do
@@ -131,7 +131,7 @@
end
describe "#menu_for" do
- it 'passes model and object as bindings and generates a menu, excluding non-get actions' do
+ it "passes model and object as bindings and generates a menu, excluding non-get actions" do
RailsAdmin.config do |config|
config.actions do
dashboard
@@ -180,14 +180,14 @@
end
describe "#main_navigation" do
- it 'should show included models' do
+ it "should show included models" do
RailsAdmin.config do |config|
config.included_models = [Ball, Comment]
end
expect(helper.main_navigation).to match /(nav\-header).*(Navigation).*(Balls).*(Comments)/m
end
- it 'should not draw empty navigation labels' do
+ it "should not draw empty navigation labels" do
RailsAdmin.config do |config|
config.included_models = [Ball, Comment, Comment::Confirmed]
config.model Comment do
@@ -201,7 +201,7 @@
expect(helper.main_navigation).not_to match /(nav\-header).*(Navigation).*(Balls).*(Commentz).*(Confirmed).*(Comment)/m
end
- it 'should not show unvisible models' do
+ it "should not show unvisible models" do
RailsAdmin.config do |config|
config.included_models = [Ball, Comment]
config.model Comment do
@@ -230,7 +230,7 @@
expect(helper.main_navigation).to match /(nav\-header).*(Navigation).*(Hardballs)/m
end
- it 'should "nest" in navigation label' do
+ it "should nest in navigation label" do
RailsAdmin.config do |config|
config.included_models = [Comment]
config.model Comment do
@@ -240,7 +240,7 @@
expect(helper.main_navigation).to match /(nav\-header).*(commentable).*(Comments)/m
end
- it 'should "nest" in parent model' do
+ it "should nest in parent model" do
RailsAdmin.config do |config|
config.included_models = [Player, Comment]
config.model Comment do
@@ -250,7 +250,7 @@
expect(helper.main_navigation).to match /(Players).*(nav\-level\-1).*(Comments)/m
end
- it 'should order' do
+ it "should order" do
RailsAdmin.config do |config|
config.included_models = [Player, Comment]
end
@@ -263,15 +263,15 @@
end
end
- describe '#static_navigation' do
- it 'should show not show static nav if no static links defined' do
+ describe "#static_navigation" do
+ it "should show not show static nav if no static links defined" do
RailsAdmin.config do |config|
config.navigation_static_links = {}
end
expect(helper.static_navigation).to be_empty
end
- it 'should show links if defined' do
+ it "should show links if defined" do
RailsAdmin.config do |config|
config.navigation_static_links = {
'Test Link' => 'http://www.google.com'
@@ -280,7 +280,7 @@
expect(helper.static_navigation).to match /Test Link/
end
- it 'should show default header if navigation_static_label not defined in config' do
+ it "should show default header if navigation_static_label not defined in config" do
RailsAdmin.config do |config|
config.navigation_static_links = {
'Test Link' => 'http://www.google.com'
@@ -289,7 +289,7 @@
expect(helper.static_navigation).to match I18n.t('admin.misc.navigation_static_label')
end
- it 'should show custom header if defined' do
+ it "should show custom header if defined" do
RailsAdmin.config do |config|
config.navigation_static_label = "Test Header"
config.navigation_static_links = {
@@ -301,7 +301,7 @@
end
describe "#bulk_menu" do
- it 'should include all visible bulkable actions' do
+ it "should include all visible bulkable actions" do
RailsAdmin.config do |config|
config.actions do
index
@@ -1,17 +1,17 @@
require 'spec_helper'
describe "RailsAdmin::FormBuilder" do
- describe '#generate' do
+ describe "#generate" do
before do
helper.stub(:authorized?).and_return(true)
(@object = Player.new).save
@builder = RailsAdmin::FormBuilder.new(:player, @object, helper, {}, nil)
@builder.stub(:field_for).and_return("field")
end
-
- it 'should not add additional error div from default ActionView::Base.field_error_proc' do
+
+ it "should not add additional error div from default ActionView::Base.field_error_proc" do
expect(@builder.generate({ :action => :create, :model_config => RailsAdmin.config(Player) })).not_to have_css(".field_with_errors")
expect(@builder.generate({ :action => :create, :model_config => RailsAdmin.config(Player) })).to have_css(".control-group.error")
end
end
-end
+end
@@ -185,7 +185,7 @@ def initialize(user)
end
describe "with history role" do
- it 'shows links to history action' do
+ it "shows links to history action" do
@user.update_attributes(:roles => [:admin, :read_player, :history_player])
@player = FactoryGirl.create :player
@@ -206,7 +206,7 @@ def initialize(user)
end
describe "with show in app role" do
- it 'shows links to show in app action' do
+ it "shows links to show in app action" do
@user.update_attributes(:roles => [:admin, :read_player, :show_in_app_player])
@player = FactoryGirl.create :player
@@ -229,7 +229,7 @@ def initialize(user)
end
describe "with all roles" do
- it 'shows links to all actions' do
+ it "shows links to all actions" do
@user.update_attributes(:roles => [:admin, :manage_player])
@player = FactoryGirl.create :player
@@ -9,14 +9,14 @@
end
describe "bulk_delete" do
- it 'should show names of to-be-deleted players' do
+ it "should show names of to-be-deleted players" do
page.driver.post(bulk_action_path(:bulk_action => 'bulk_delete', :model_name => "player", :bulk_ids => @players.map(&:id)))
@players.each { |player| should have_content(player.name) }
end
end
describe "bulk_export" do
- it 'should show form for export' do
+ it "should show form for export" do
visit index_path(:model_name => "player")
click_link "Export found Players"
@players.each { |player| should have_content("Select fields to export") }
@@ -4,7 +4,7 @@
subject { page }
- it 'should create object with correct attributes' do
+ it "should create object with correct attributes" do
visit new_path(:model_name => "cms~basic_page")
fill_in "cms_basic_page[title]", :with => "Hello"
@@ -61,8 +61,8 @@
end
end
- describe 'destroy from show page' do
- it 'should redirect to the index instead of trying to show the deleted object' do
+ describe "destroy from show page" do
+ it "should redirect to the index instead of trying to show the deleted object" do
@player = FactoryGirl.create :player
visit show_path(:model_name => 'player', :id => @player.id)
visit delete_path(:model_name => "player", :id => @player.id)
@@ -71,7 +71,7 @@
expect(URI.parse(page.current_url).path).to eq(index_path(:model_name => 'player'))
end
- it 'should redirect back to the object on error' do
+ it "should redirect back to the object on error" do
Player.any_instance.stub(:destroy_hook).and_return false
@player = FactoryGirl.create :player
visit show_path(:model_name => 'player', :id => @player.id)
@@ -42,7 +42,7 @@
describe "readonly associations" do
- it 'should not be editable' do
+ it "should not be editable" do
@league = FactoryGirl.create :league
visit edit_path(:model_name => "league", :id => @league.id)
should_not have_selector('select#league_team_ids')
@@ -5,13 +5,13 @@
subject { page }
describe "AbstractModel#to_param" do
- it 'turns namespaces into prefixes with ~' do
+ it "turns namespaces into prefixes with ~" do
expect(RailsAdmin::AbstractModel.new("Cms::BasicPage").to_param).to eq('cms~basic_page')
end
end
describe "ApplicationController#to_model_name" do
- it 'turns cms~basic_page into Cms::BasicPage' do
+ it "turns cms~basic_page into Cms::BasicPage" do
expect(RailsAdmin::ApplicationController.new.to_model_name('cms~basic_page')).to eq('Cms::BasicPage')
end
end
@@ -21,7 +21,7 @@
visit new_path(:model_name => "cms~basic_page")
end
- it 'should have correct input field names' do
+ 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]")
Oops, something went wrong.

0 comments on commit e2a7060

Please sign in to comment.