Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename assertions

  • Loading branch information...
commit 02c03c15f613970071e97e15ff8d43e26e651b04 1 parent e2a7060
@sferik authored
Showing with 338 additions and 338 deletions.
  1. +7 −7 spec/controllers/main_controller_spec.rb
  2. +19 −19 spec/helpers/application_helper_spec.rb
  3. +1 −1  spec/helpers/form_builder_spec.rb
  4. +2 −2 spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb
  5. +2 −2 spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb
  6. +9 −9 spec/integration/basic/create/rails_admin_basic_create_spec.rb
  7. +1 −1  spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb
  8. +4 −4 spec/integration/basic/delete/rails_admin_basic_delete_spec.rb
  9. +8 −8 spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb
  10. +10 −10 spec/integration/basic/edit/rails_admin_basic_edit_spec.rb
  11. +5 −5 spec/integration/basic/export/rails_admin_basic_export_spec.rb
  12. +25 −25 spec/integration/basic/list/rails_admin_basic_list_spec.rb
  13. +8 −8 spec/integration/basic/new/rails_admin_basic_new_spec.rb
  14. +1 −1  spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
  15. +6 −6 spec/integration/basic/show/rails_admin_basic_show_spec.rb
  16. +13 −13 spec/integration/basic/update/rails_admin_basic_update_spec.rb
  17. +59 −59 spec/integration/config/edit/rails_admin_config_edit_spec.rb
  18. +28 −28 spec/integration/config/list/rails_admin_config_list_spec.rb
  19. +20 −20 spec/integration/config/show/rails_admin_config_show_spec.rb
  20. +6 −6 spec/integration/history/rails_admin_history_spec.rb
  21. +14 −14 spec/integration/rails_admin_spec.rb
  22. +3 −3 spec/integration/relation_spec.rb
  23. +7 −7 spec/unit/adapters/active_record/abstract_object_spec.rb
  24. +4 −4 spec/unit/adapters/mongoid_spec.rb
  25. +2 −2 spec/unit/config/actions/base_spec.rb
  26. +14 −14 spec/unit/config/actions_spec.rb
  27. +29 −29 spec/unit/config/fields/base_spec.rb
  28. +4 −4 spec/unit/config/fields/date_spec.rb
  29. +4 −4 spec/unit/config/fields/datetime_spec.rb
  30. +3 −3 spec/unit/config/fields/time_spec.rb
  31. +1 −1  spec/unit/config/fields/timestamp_spec.rb
  32. +10 −10 spec/unit/config/model_spec.rb
  33. +4 −4 spec/unit/config/sections_spec.rb
  34. +5 −5 spec/unit/config_spec.rb
View
14 spec/controllers/main_controller_spec.rb
@@ -9,12 +9,12 @@
controller.stub(:render).and_return(true) # no rendering
end
- it "should show statistics by default" do
+ it "shows statistics by default" do
RailsAdmin.config(Player).abstract_model.should_receive(:count).and_return(0)
controller.dashboard
end
- it "should not show statistics if turned off" do
+ it "does not show statistics if turned off" do
RailsAdmin.config do |c|
c.actions do
dashboard do
@@ -30,7 +30,7 @@
describe "#check_for_cancel" do
- it "should redirect to back if params[:bulk_ids] is nil when params[:bulk_action] is present" do
+ it "redirects to back if params[:bulk_ids] is nil when params[:bulk_action] is present" do
controller.stub(:back_or_index) { raise StandardError.new('redirected back') }
expect { get :bulk_delete, { :model_name => "player", :bulk_action =>"bulk_delete" } }.to raise_error('redirected back')
expect { get :bulk_delete, { :model_name => "player", :bulk_action =>"bulk_delete", :bulk_ids => [] } }.to_not raise_error('redirected back')
@@ -38,12 +38,12 @@
end
describe "#get_sort_hash" do
- it "should work with belongs_to associations with label method virtual" do
+ it "works 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 "works 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
@@ -55,7 +55,7 @@
controller.params = { :model_name => "teams" }
end
- it "should paginate" do
+ it "paginates" do
expect(controller.list_entries(RailsAdmin.config(Team), :index, nil, false).to_a.length).to eq(21)
expect(controller.list_entries(RailsAdmin.config(Team), :index, nil, true).to_a.length).to eq(20)
end
@@ -67,7 +67,7 @@
controller.params = { :model_name => "teams", :bulk_action => "bulk_delete", :bulk_ids => @teams.map(&:id) }
end
- it "should not paginate" do
+ it "does not paginate" do
expect(controller.list_entries(RailsAdmin.config(Team), :bulk_delete).to_a.length).to eq(21)
end
end
View
38 spec/helpers/application_helper_spec.rb
@@ -7,7 +7,7 @@
end
describe "#current_action?" do
- it "should return true if current_action, false otherwise" do
+ it "returns 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
@@ -16,7 +16,7 @@
end
describe "#action" do
- it "should return action by :custom_key" do
+ it "returns 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 "returns 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 "returns 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 "returns 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 "only returns visible actions, passing bindings correctly" do
RailsAdmin.config do |config|
config.actions do
member :test_bindings do
@@ -180,14 +180,14 @@
end
describe "#main_navigation" do
- it "should show included models" do
+ it "shows 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 "does 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 "does not show unvisible models" do
RailsAdmin.config do |config|
config.included_models = [Ball, Comment]
config.model Comment do
@@ -213,7 +213,7 @@
expect(result).not_to match "Comments"
end
- it "should show children of hidden models" do # https://github.com/sferik/rails_admin/issues/978
+ it "shows children of hidden models" do # https://github.com/sferik/rails_admin/issues/978
RailsAdmin.config do |config|
config.included_models = [Ball, Hardball]
config.model Ball do
@@ -223,14 +223,14 @@
expect(helper.main_navigation).to match /(nav\-header).*(Navigation).*(Hardballs)/m
end
- it "should show children of excluded models" do
+ it "shows children of excluded models" do
RailsAdmin.config do |config|
config.included_models = [Hardball]
end
expect(helper.main_navigation).to match /(nav\-header).*(Navigation).*(Hardballs)/m
end
- it "should nest in navigation label" do
+ it "nests 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 "nests 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 "orders" do
RailsAdmin.config do |config|
config.included_models = [Player, Comment]
end
@@ -264,14 +264,14 @@
end
describe "#static_navigation" do
- it "should show not show static nav if no static links defined" do
+ it "shows 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 "shows 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 "shows 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 "shows 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 "includes all visible bulkable actions" do
RailsAdmin.config do |config|
config.actions do
index
View
2  spec/helpers/form_builder_spec.rb
@@ -9,7 +9,7 @@
@builder.stub(:field_for).and_return("field")
end
- it "should not add additional error div from default ActionView::Base.field_error_proc" do
+ it "does 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
View
4 spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb
@@ -9,14 +9,14 @@
end
describe "bulk_delete" do
- it "should show names of to-be-deleted players" do
+ it "shows 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 "shows 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") }
View
4 spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb
@@ -14,7 +14,7 @@
click_button "Yes, I'm sure"
end
- it "should not contain deleted records" do
+ it "does not contain deleted records" do
expect(RailsAdmin::AbstractModel.new("Player").count).to eq(1)
expect(RailsAdmin::History.count).to eq(@delete_ids.count)
RailsAdmin::History.all.each do |history|
@@ -35,7 +35,7 @@
click_button "Cancel"
end
- it "should not delete records" do
+ it "does not delete records" do
expect(RailsAdmin::AbstractModel.new("Player").count).to eq(3)
end
end
View
18 spec/integration/basic/create/rails_admin_basic_create_spec.rb
@@ -13,7 +13,7 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should create an object with correct attributes" do
+ it "creates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(42)
expect(@player.position).to eq("Second baseman")
@@ -32,7 +32,7 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should create an object with correct attributes" do
+ it "creates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(42)
expect(@player.position).to eq("Second baseman")
@@ -51,7 +51,7 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should create an object with correct attributes" do
+ it "creates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(42)
expect(@player.position).to eq("Second baseman")
@@ -67,7 +67,7 @@
@player = RailsAdmin::AbstractModel.new("Player").all.last # first is created by FactoryGirl
end
- it "should create an object with correct associations" do
+ it "creates an object with correct associations" do
@draft.reload
expect(@player.draft).to eq(@draft)
end
@@ -80,7 +80,7 @@
@league = RailsAdmin::AbstractModel.new("League").all.last
end
- it "should create an object with correct associations" do
+ it "creates an object with correct associations" do
@divisions[0].reload
expect(@league.divisions).to include(@divisions[0])
expect(@league.divisions).not_to include(@divisions[1])
@@ -95,7 +95,7 @@
@fan = RailsAdmin::AbstractModel.new("Fan").first
end
- it "should create an object with correct associations" do
+ it "creates an object with correct associations" do
@teams[0].reload
expect(@fan.teams).to include(@teams[0])
expect(@fan.teams).not_to include(@teams[1])
@@ -111,7 +111,7 @@
page.driver.post new_path(:model_name => "player", :player => {:name => @player.name, :number => @player.number.to_s, :position => @player.position, :team_id => @team.id})
end
- it "should show an error message" do
+ it "shows an error message" do
should have_content("There is already a player with that number on this team")
end
end
@@ -121,7 +121,7 @@
page.driver.post(new_path(:model_name => "player", :id => 1), :params => {:player => {}})
end
- it "should show an error message" do
+ it "shows an error message" do
should have_content("Player failed to be created")
should have_selector "form", :action => "/admin/players"
end
@@ -134,7 +134,7 @@
click_button "Save and add another"
end
- it "should show error base error message in flash" do
+ it "shows error base error message in flash" do
should have_content("Player failed to be created. Player is cheating")
end
end
View
2  spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb
@@ -4,7 +4,7 @@
subject { page }
- it "should create object with correct attributes" do
+ it "creates object with correct attributes" do
visit new_path(:model_name => "cms~basic_page")
fill_in "cms_basic_page[title]", :with => "Hello"
View
8 spec/integration/basic/delete/rails_admin_basic_delete_spec.rb
@@ -5,7 +5,7 @@
subject { page }
describe "delete" do
- it "should show \"Delete model\"" do
+ it "shows \"Delete model\"" do
@draft = FactoryGirl.create :draft
@player = @draft.player
@comment = @player.comments.create
@@ -22,7 +22,7 @@
visit delete_path(:model_name => "player", :id => 1)
end
- it "should raise NotFound" do
+ it "raises NotFound" do
expect(page.driver.status_code).to eq(404)
end
end
@@ -40,7 +40,7 @@
visit delete_path(:model_name => "player", :id => @player.id)
end
- it "should show \"Delete model\"" do
+ it "shows \"Delete model\"" do
should have_content("delete this player")
should_not have_selector("a[href=\"/admin/player/#{@player.id}\"]")
should_not have_selector("a[href=\"/admin/draft/#{@draft.id}\"]")
@@ -55,7 +55,7 @@
visit delete_path(:model_name => "player", :id => @player.id)
end
- it "should show \"Delete model\"" do
+ it "shows \"Delete model\"" do
should_not have_content("Routing Error")
should have_content("delete this player")
should have_link(@player.name, :href => "/admin/player/#{@player.id}")
View
16 spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb
@@ -12,11 +12,11 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should destroy an object" do
+ it "destroys an object" do
expect(@player).to be_nil
end
- it "should show success message" do
+ it "shows success message" do
should have_content('Player successfully deleted')
end
end
@@ -29,11 +29,11 @@
click_button "Yes, I'm sure"
end
- it "should not destroy an object" do
+ it "does not destroy an object" do
expect(@player.reload).to be
end
- it "should show error message" do
+ it "shows error message" do
should have_content('Player failed to be deleted')
end
end
@@ -46,7 +46,7 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should not destroy an object" do
+ it "does not destroy an object" do
expect(@player).to be
end
end
@@ -56,13 +56,13 @@
page.driver.delete(delete_path(:model_name => "player", :id => 1))
end
- it "should raise NotFound" do
+ it "raises NotFound" do
expect(page.driver.status_code).to eq(404)
end
end
describe "destroy from show page" do
- it "should redirect to the index instead of trying to show the deleted object" do
+ it "redirects 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 "redirects 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)
View
20 spec/integration/basic/edit/rails_admin_basic_edit_spec.rb
@@ -10,16 +10,16 @@
visit edit_path(:model_name => "player", :id => @player.id)
end
- it "should show \"Edit model\"" do
+ it "shows \"Edit model\"" do
should have_content("Edit Player")
end
- it "should show required fields as \"Required\"" do
+ it "shows required fields as \"Required\"" do
should have_selector("div", :text => /Name\s*Required/)
should have_selector("div", :text => /Number\s*Required/)
end
- it "should show non-required fields as \"Optional\"" do
+ it "shows non-required fields as \"Optional\"" do
expect(find("#player_position_field .help-block")).to have_content("Optional")
expect(find("#player_born_on_field .help-block")).to have_content("Optional")
expect(find("#player_notes_field .help-block")).to have_content("Optional")
@@ -27,13 +27,13 @@
end
describe "association with inverse_of option" do
- it "should add a related id to the belongs_to create team link" do
+ it "adds a related id to the belongs_to create team link" do
@player = FactoryGirl.create :player
visit edit_path(:model_name => "player", :id => @player.id)
should have_selector("a", :href => 'admin/teams/new?associations[players]=' + @player.id.to_s)
end
- it "should add a related id to the has_many create team link" do
+ it "adds a related id to the has_many create team link" do
@team = FactoryGirl.create :team
visit edit_path(:model_name => "team", :id => @team.id)
should have_selector("a", :href => 'admin/players/new?associations[team]=' + @team.id.to_s)
@@ -42,7 +42,7 @@
describe "readonly associations" do
- it "should not be editable" do
+ it "is not editable" do
@league = FactoryGirl.create :league
visit edit_path(:model_name => "league", :id => @league.id)
should_not have_selector('select#league_team_ids')
@@ -57,7 +57,7 @@
visit edit_path(:model_name => "fan", :id => @fan.id)
end
- it "should show associated objects" do
+ it "shows associated objects" do
should have_selector "#fan_team_ids" do |select|
expect(select[0]).to have_selector 'option[selected="selected"]'
expect(select[1]).not_to have_selector 'option[selected="selected"]'
@@ -71,7 +71,7 @@
visit edit_path(:model_name => "player", :id => 1)
end
- it "should raise NotFound" do
+ it "raises NotFound" do
expect(page.driver.status_code).to eq(404)
end
end
@@ -90,7 +90,7 @@
visit edit_path(:model_name => "ball", :id => @ball.id)
end
- it "should display a link to the delete page" do
+ it "displays a link to the delete page" do
should have_selector "a[href='/admin/ball/#{@ball.id}/delete']"
end
@@ -98,7 +98,7 @@
describe "clicking cancel when editing an object" do
- it "should send back to previous URL" do
+ it "sends back to previous URL" do
@ball = FactoryGirl.create :ball
visit '/admin/ball?sort=color'
click_link 'Edit'
View
10 spec/integration/basic/export/rails_admin_basic_export_spec.rb
@@ -30,7 +30,7 @@
describe "POST /admin/players/export (prompt)" do
- it "should allow to export to CSV with associations and default schema, containing properly translated header and follow configuration" do
+ it "allows to export to CSV with associations and default schema, containing properly translated header and follow configuration" do
RailsAdmin.config do |c|
c.model Player do
include_all_fields
@@ -63,13 +63,13 @@
expect(csv.flatten.join(' ')).to include(@player.comments.second.content.split("\n").first.strip)
end
- it "should allow to export to JSON" do
+ it "allows to export to JSON" do
visit export_path(:model_name => 'player')
click_button 'Export to json'
should have_content @player.team.name
end
- it "should allow to export to XML" do
+ it "allows to export to XML" do
visit export_path(:model_name => 'player')
click_button 'Export to xml'
@@ -83,7 +83,7 @@
end
end
- it "should export polymorphic fields the easy way for now" do
+ it "exports polymorphic fields the easy way for now" do
visit export_path(:model_name => 'comment')
select "<comma> ','", :from => "csv_options_generator_col_sep"
click_button 'Export to csv'
@@ -97,7 +97,7 @@
end
describe "POST /admin/players/export :format => :csv" do
- it "should export with modified schema" do
+ it "exports with modified schema" do
page.driver.post(export_path(:model_name => 'player', :schema => @non_default_schema, :csv => true, :all => true, :csv_options => { :generator => { :col_sep => "," } }))
csv = CSV.parse find('body').text
expect(csv[0]).not_to include('Created at')
View
50 spec/integration/basic/list/rails_admin_basic_list_spec.rb
@@ -7,13 +7,13 @@
subject { page }
describe "GET /admin" do
- it "should respond successfully" do
+ it "responds successfully" do
visit dashboard_path
end
end
describe "GET /admin/typo" do
- it "should redirect to dashboard and inform the user the model wasn't found" do
+ it "redirects to dashboard and inform the user the model wasn't found" do
visit '/admin/whatever'
expect(page.driver.status_code).to eq(404)
expect(find('.alert-error')).to have_content("Model 'Whatever' could not be found")
@@ -21,7 +21,7 @@
end
describe "GET /admin/balls/545-typo" do
- it "should redirect to balls index and inform the user the id wasn't found" do
+ it "redirects to balls index and inform the user the id wasn't found" do
visit '/admin/ball/545-typo'
expect(page.driver.status_code).to eq(404)
expect(find('.alert-error')).to have_content("Ball with id '545-typo' could not be found")
@@ -29,7 +29,7 @@
end
describe "GET /admin/player as list" do
- it "should show \"List of Models\", should show filters and should show column headers" do
+ it "shows \"List of Models\", should show filters and should show column headers" do
21.times { FactoryGirl.create :player } # two pages of players
visit index_path(:model_name => "player")
should have_content("List of Players")
@@ -47,7 +47,7 @@
# https://github.com/sferik/rails_admin/issues/362
# test that no link uses the "wildcard route" with the main
# controller and list method
- # it "should not use the 'wildcard route'" do
+ # it "does not use the 'wildcard route'" do
should have_selector("a[href*='all=true']") # make sure we're fully testing pagination
should have_no_selector("a[href^='/rails_admin/main/list']")
end
@@ -74,7 +74,7 @@
]
end
- it "should allow to query on any attribute" do
+ it "allows to query on any attribute" do
visit index_path(:model_name => "player", :query => @players[0].name)
should have_content(@players[0].name)
(1..3).each do |i|
@@ -82,7 +82,7 @@
end
end
- it "should allow to filter on one attribute" do
+ it "allows to filter on one attribute" do
visit index_path(:model_name => "player", :f => {:injured => {"1" => {:v => "true"}}})
should have_content(@players[0].name)
should have_no_content(@players[1].name)
@@ -90,7 +90,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to combine filters on two different attributes" do
+ it "allows to combine filters on two different attributes" do
visit index_path(:model_name => "player", :f => {:retired => {"1" => {:v => "true"}}, :injured => {"1" => {:v => "true"}}})
should have_content(@players[0].name)
(1..3).each do |i|
@@ -98,7 +98,7 @@
end
end
- it "should allow to filter on belongs_to relationships" do
+ it "allows to filter on belongs_to relationships" do
visit index_path(:model_name => "player", :f => {:team => {"1" => { :v => @teams[0].name }}})
should have_content(@players[0].name)
should have_content(@players[1].name)
@@ -106,7 +106,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to disable search on attributes" do
+ it "allows to disable search on attributes" do
RailsAdmin.config Player do
list do
field :position
@@ -119,7 +119,7 @@
should have_no_content(@players[0].name)
end
- it "should allow to search a belongs_to attribute over the base table" do
+ it "allows to search a belongs_to attribute over the base table" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -137,7 +137,7 @@
end
- it "should allow to search a belongs_to attribute over the target table" do
+ it "allows to search a belongs_to attribute over the target table" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -154,7 +154,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to search a belongs_to attribute over the target table with a table name specified as a hash" do
+ it "allows to search a belongs_to attribute over the target table with a table name specified as a hash" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -171,7 +171,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to search a belongs_to attribute over the target table with a table name specified as a string" do
+ it "allows to search a belongs_to attribute over the target table with a table name specified as a string" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -188,7 +188,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to search a belongs_to attribute over the label method by default" do
+ it "allows to search a belongs_to attribute over the label method by default" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -203,7 +203,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to search a belongs_to attribute over the target table when an attribute is specified" do
+ it "allows to search a belongs_to attribute over the target table when an attribute is specified" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -220,7 +220,7 @@
should have_no_content(@players[3].name)
end
- it "should allow to search over more than one attribute" do
+ it "allows to search over more than one attribute" do
RailsAdmin.config Player do
list do
field PK_COLUMN
@@ -243,7 +243,7 @@
should have_no_content(@players[3].name)
end
- it "should display base filters when no filters are present in the params" do
+ it "displays base filters when no filters are present in the params" do
RailsAdmin.config Player do
list do
filters [:name, :team]
@@ -262,7 +262,7 @@
visit index_path(:model_name => "player")
end
- it "should show \"2 results\"" do
+ it "shows \"2 results\"" do
should have_content("2 players")
end
end
@@ -273,7 +273,7 @@
visit index_path(:model_name => "player")
end
- it "should show \"20 results\"" do
+ it "shows \"20 results\"" do
should have_content("20 players")
end
end
@@ -285,7 +285,7 @@
visit index_path(:model_name => "player", :page => 2)
end
- it "should paginate correctly" do
+ it "paginates correctly" do
expect(find('.pagination ul li:first')).to have_content("« Prev")
expect(find('.pagination ul li:last')).to have_content("Next »")
expect(find('.pagination ul li.active')).to have_content("2")
@@ -299,7 +299,7 @@
visit index_path(:model_name => "player", :page => 3)
end
- it "should paginate correctly and contain the right item" do
+ it "paginates correctly and contain the right item" do
expect(find('.pagination ul li:first')).to have_content("« Prev")
expect(find('.pagination ul li:last')).to have_content("Next »")
expect(find('.pagination ul li.active')).to have_content("3")
@@ -307,7 +307,7 @@
end
describe "GET /admin/player show all" do
- it "should respond successfully" do
+ it "responds successfully" do
2.times.map { FactoryGirl.create :player }
visit index_path(:model_name => "player", :all => true)
expect(find('div.total-count')).to have_content("2 players")
@@ -315,7 +315,7 @@
end
describe "GET /admin/player show with pagination disabled by :associated_collection" do
- it "should respond successfully" do
+ it "responds successfully" do
@team = FactoryGirl.create :team
2.times.map { FactoryGirl.create :player, :team => @team }
visit index_path(:model_name => "player", :associated_collection => "players", :compact => true, :current_action => 'update', :source_abstract_model => 'team', :source_object_id => @team.id)
@@ -324,7 +324,7 @@
end
describe "list as compact json" do
- it "should have_content an array with 2 elements and contain an array of elements with keys id and label" do
+ it "has_content an array with 2 elements and contain an array of elements with keys id and label" do
2.times.map { FactoryGirl.create :player }
response = page.driver.get(index_path(:model_name => "player", :compact => true, :format => :json))
expect(ActiveSupport::JSON.decode(response.body).length).to eq(2)
View
16 spec/integration/basic/new/rails_admin_basic_new_spec.rb
@@ -9,16 +9,16 @@
visit new_path(:model_name => "player")
end
- it "should show \"New Model\"" do
+ it "shows \"New Model\"" do
should have_content("New Player")
end
- it "should show required fields as \"Required\"" do
+ it "shows required fields as \"Required\"" do
should have_selector("div", :text => /Name\s*Required/)
should have_selector("div", :text => /Number\s*Required/)
end
- it "should show non-required fields as \"Optional\"" do
+ it "shows non-required fields as \"Optional\"" do
should have_selector("#player_position_field .help-block", :text => "Optional")
should have_selector("#player_born_on_field .help-block", :text => "Optional")
should have_selector("#player_notes_field .help-block", :text => "Optional")
@@ -27,7 +27,7 @@
# https://github.com/sferik/rails_admin/issues/362
# test that no link uses the "wildcard route" with the main
# controller and new method
- it "should not use the 'wildcard route'" do
+ it "does not use the 'wildcard route'" do
should have_no_selector("a[href^='/rails_admin/main/new']")
end
end
@@ -38,7 +38,7 @@
visit new_path(:model_name => "player")
end
- it "should show selects" do
+ it "shows selects" do
should have_selector("select#player_draft_id")
should have_selector("select#player_team_id")
should have_selector("select#player_comment_ids")
@@ -53,18 +53,18 @@
end
describe "GET /admin/player/new with parameters for pre-population" do
- it "should populate form field when corresponding parameters are passed in" do
+ it "populates form field when corresponding parameters are passed in" do
visit new_path(:model_name => 'player', :player => {:name => 'Sam'})
expect(page).to have_css('input[value=Sam]')
end
- it "should prepropulate belongs to relationships" do
+ it "prepropulates belongs to relationships" do
@team = FactoryGirl.create :team, :name => "belongs_to association prepopulated"
visit new_path(:model_name => 'player', :associations => { :team => @team.id } )
expect(page).to have_css("select#player_team_id option[selected='selected'][value='#{@team.id}']")
end
- it "should prepropulate has_many relationships" do
+ it "prepropulates has_many relationships" do
@player = FactoryGirl.create :player, :name => "has_many association prepopulated"
visit new_path(:model_name => 'team', :associations => { :players => @player.id } )
expect(page).to have_css("select#team_player_ids option[selected='selected'][value='#{@player.id}']")
View
2  spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb
@@ -21,7 +21,7 @@
visit new_path(:model_name => "cms~basic_page")
end
- it "should have correct input field names" do
+ it "has 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]")
View
12 spec/integration/basic/show/rails_admin_basic_show_spec.rb
@@ -4,7 +4,7 @@
subject { page }
describe "show" do
- it "should have History, Edit, Delete, Details and attributes" do
+ it "has History, Edit, Delete, Details and attributes" do
@player = FactoryGirl.create :player
visit show_path(:model_name => "player", :id => @player.id)
@@ -20,7 +20,7 @@
end
describe "GET /admin/players/123this-id-doesnt-exist" do
- it "should raise NotFound" do
+ it "raises NotFound" do
visit '/admin/players/123this-id-doesnt-exist'
expect(page.driver.status_code).to eq(404)
end
@@ -34,7 +34,7 @@
visit show_path(:model_name => "player", :id => @player.id)
end
- it "should show associated objects" do
+ it "shows associated objects" do
should have_css("a[href='/admin/team/#{@team.id}']")
end
end
@@ -46,7 +46,7 @@
visit show_path(:model_name => "player", :id => @player.id)
end
- it "should show associated objects" do
+ it "shows associated objects" do
should have_css("a[href='/admin/draft/#{@draft.id}']")
end
end
@@ -61,7 +61,7 @@
visit show_path(:model_name => "player", :id => @player.id)
end
- it "should show associated objects" do
+ it "shows associated objects" do
should have_css("a[href='/admin/comment/#{@comment1.id}']")
should have_css("a[href='/admin/comment/#{@comment2.id}']")
should_not have_css("a[href='/admin/comment/#{@comment3.id}']")
@@ -75,7 +75,7 @@
visit show_path(:model_name => "comment", :id => @comment.id)
end
- it "should show associated object" do
+ it "shows associated object" do
should have_css("a[href='/admin/player/#{@player.id}']")
end
end
View
26 spec/integration/basic/update/rails_admin_basic_update_spec.rb
@@ -10,7 +10,7 @@
visit edit_path(:model_name => "player", :id => @player.id)
end
- it "should return to edit page" do
+ it "returns to edit page" do
fill_in "player[name]", :with => ""
click_button "Save"
expect(page.driver.status_code).to eq(406)
@@ -32,7 +32,7 @@
@player = RailsAdmin::AbstractModel.new("Player").first
end
- it "should update an object with correct attributes" do
+ it "updates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(42)
expect(@player.position).to eq("Second baseman")
@@ -53,7 +53,7 @@
@player.reload
end
- it "should update an object with correct attributes" do
+ it "updates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(42)
expect(@player.position).to eq("Second baseman")
@@ -69,20 +69,20 @@
@player.reload
end
- it "should update an object with correct attributes" do
+ it "updates an object with correct attributes" do
expect(@player.name).to eq("Jackie Robinson")
expect(@player.number).to eq(@number)
expect(@player.position).to eq("Second baseman")
end
- it "should update an object with correct associations" do
+ it "updates an object with correct associations" do
@draft.reload
expect(@player.draft).to eq(@draft)
end
end
describe "update with has-many association" do
- it "should be fillable and emptyable", :active_record => true do
+ it "is fillable and emptyable", :active_record => true do
RailsAdmin.config do |c|
c.audit_with :history
end
@@ -114,7 +114,7 @@
page.driver.put(edit_path(:model_name => "player", :id => 1), :params => {:player => {:name => "Jackie Robinson", :number => 42, :position => "Second baseman"}})
end
- it "should raise NotFound" do
+ it "raises NotFound" do
expect(page.driver.status_code).to eq(404)
end
end
@@ -133,7 +133,7 @@
@player.reload
end
- it "should show an error message" do
+ it "shows an error message" do
# TODO: Mongoid 3.0.0 lacks ability of numericality validation on Integer field.
# This is caused by change in https://github.com/mongoid/mongoid/pull/1698
# I believe this should be a bug in Mongoid.
@@ -159,7 +159,7 @@
@user.reload
end
- it "should save the serialized data" do
+ it "saves the serialized data" do
expect(@user.roles).to eq(['admin','user'])
end
end
@@ -171,7 +171,7 @@
visit edit_path(:model_name => "field_test", :id => @field_test.id)
end
- it "should save the serialized data" do
+ it "saves the serialized data" do
fill_in "field_test[array_field]", :with => "[4, 2]"
fill_in "field_test[hash_field]", :with => "{ a: 6, b: 2 }"
click_button "Save"
@@ -181,7 +181,7 @@
expect(@field_test.hash_field).to eq({ "a" => 6, "b" => 2 })
end
- it "should clear data when empty string is passed" do
+ it "clears data when empty string is passed" do
fill_in "field_test[array_field]", :with => ""
fill_in "field_test[hash_field]", :with => ""
click_button "Save"
@@ -204,7 +204,7 @@
@ball.reload
end
- it "should update an object with correct attributes" do
+ it "updates an object with correct attributes" do
expect(@ball.color).to eq("gray")
end
end
@@ -221,7 +221,7 @@
@hardball.reload
end
- it "should update an object with correct attributes" do
+ it "updates an object with correct attributes" do
expect(@hardball.color).to eq("cyan")
end
end
View
118 spec/integration/config/edit/rails_admin_config_edit_spec.rb
@@ -8,7 +8,7 @@
describe " a field with 'format' as a name (Kernel function)" do
- it "should be updatable without any error" do
+ it "is updatable without any error" do
RailsAdmin.config FieldTest do
edit do
field :format
@@ -24,7 +24,7 @@
describe "default_value" do
- it "should be set for all types of input fields" do
+ it "is set for all types of input fields" do
RailsAdmin.config do |config|
config.excluded_models = []
config.model(FieldTest) do
@@ -55,7 +55,7 @@
expect(has_checked_field?('field_test[boolean_field]')).to be_true
end
- it "should set default value for selects" do
+ it "sets default value for selects" do
RailsAdmin.config(Team) do
field :color, :enum do
default_value 'black'
@@ -72,7 +72,7 @@
describe "attr_accessible" do
- it "should be configurable in the controller scope" do
+ it "is configurable in the controller scope" do
RailsAdmin.config do |config|
config.excluded_models = []
@@ -101,7 +101,7 @@
end
describe "css hooks" do
- it "should be present" do
+ it "is present" do
visit new_path(:model_name => "team")
should have_selector("#team_division_id_field.belongs_to_association_type.division_field")
end
@@ -109,7 +109,7 @@
describe "field groupings" do
- it "should be hideable" do
+ it "is hideable" do
RailsAdmin.config Team do
edit do
group :default do
@@ -135,7 +135,7 @@
should have_no_selector("input#team_revenue")
end
- it "should hide association groupings" do
+ it "hides association groupings" do
RailsAdmin.config Team do
edit do
group :players do
@@ -152,7 +152,7 @@
should have_no_selector("select#team_player_ids")
end
- it "should be renameable" do
+ it "is renameable" do
RailsAdmin.config Team do
edit do
group :default do
@@ -180,24 +180,24 @@ class HelpTest < Tableless
end
context "using mongoid", :skip_active_record => true do
- it "should use the db column size for the maximum length" do
+ it "uses the db column size for the maximum length" do
visit new_path(:model_name => "help_test")
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 255.")
end
- it "should return nil for the maximum length" do
+ it "returns nil for the maximum length" do
visit new_path(:model_name => "team")
expect(find("#team_custom_field_field .help-block")).not_to have_content("Length")
end
end
context "using active_record", :skip_mongoid => true do
- it "should use the db column size for the maximum length" do
+ it "uses the db column size for the maximum length" do
visit new_path(:model_name => "help_test")
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 50.")
end
- it "should use the :minimum setting from the validation" do
+ it "uses the :minimum setting from the validation" do
HelpTest.class_eval do
validates_length_of :name, :minimum => 1
end
@@ -205,7 +205,7 @@ class HelpTest < Tableless
expect(find("#help_test_name_field .help-block")).to have_content("Length of 1-50.")
end
- it "should use the minimum of db column size or :maximum setting from the validation" do
+ it "uses the minimum of db column size or :maximum setting from the validation" do
HelpTest.class_eval do
validates_length_of :name, :maximum => 51
end
@@ -214,7 +214,7 @@ class HelpTest < Tableless
end
end
- it "should show help section if present" do
+ it "shows help section if present" do
RailsAdmin.config HelpTest do
edit do
group :default do
@@ -226,7 +226,7 @@ class HelpTest < Tableless
should have_selector('fieldset>p', :text => "help paragraph to display")
end
- it "should not show help if not present" do
+ it "does not show help if not present" do
RailsAdmin.config HelpTest do
edit do
group :default do
@@ -238,7 +238,7 @@ class HelpTest < Tableless
should_not have_selector('fieldset>p')
end
- it "should be able to display multiple help if there are multiple sections" do
+ it "is able to display multiple help if there are multiple sections" do
RailsAdmin.config HelpTest do
edit do
group :default do
@@ -258,7 +258,7 @@ class HelpTest < Tableless
should have_selector("fieldset>p", :count => 2)
end
- it "should use the :is setting from the validation" do
+ it "uses the :is setting from the validation" do
HelpTest.class_eval do
validates_length_of :name, :is => 3
end
@@ -266,7 +266,7 @@ class HelpTest < Tableless
expect(find("#help_test_name_field .help-block")).to have_content("Length of 3.")
end
- it "should use the :maximum setting from the validation" do
+ it "uses the :maximum setting from the validation" do
HelpTest.class_eval do
validates_length_of :name, :maximum => 49
end
@@ -274,7 +274,7 @@ class HelpTest < Tableless
expect(find("#help_test_name_field .help-block")).to have_content("Length up to 49.")
end
- it "should use the :minimum and :maximum from the validation" do
+ it "uses the :minimum and :maximum from the validation" do
HelpTest.class_eval do
validates_length_of :name, :minimum => 1, :maximum => 49
end
@@ -282,7 +282,7 @@ class HelpTest < Tableless
expect(find("#help_test_name_field .help-block")).to have_content("Length of 1-49.")
end
- it "should use the range from the validation" do
+ it "uses the range from the validation" do
HelpTest.class_eval do
validates_length_of :name, :in => 1..49
end
@@ -292,7 +292,7 @@ class HelpTest < Tableless
end
- it "should have accessor for its fields" do
+ it "has accessor for its fields" do
RailsAdmin.config Team do
edit do
group :default do
@@ -322,7 +322,7 @@ class HelpTest < Tableless
should have_selector(".control-group", :count => 4)
end
- it "should have accessor for its fields by type" do
+ it "has accessor for its fields by type" do
RailsAdmin.config Team do
edit do
group :default do
@@ -350,7 +350,7 @@ class HelpTest < Tableless
describe "items' fields" do
- it "should show all by default" do
+ it "shows all by default" do
visit new_path(:model_name => "team")
should have_selector("select#team_division_id")
should have_selector("input#team_name")
@@ -367,7 +367,7 @@ class HelpTest < Tableless
should have_selector("select#team_fan_ids")
end
- it "should appear in order defined" do
+ it "appears in order defined" do
RailsAdmin.config Team do
edit do
field :manager
@@ -381,7 +381,7 @@ class HelpTest < Tableless
should have_selector(:xpath, "//*[contains(@class, 'field')][3]//*[@id='team_name']")
end
- it "should only show the defined fields if some fields are defined" do
+ it "only shows the defined fields if some fields are defined" do
RailsAdmin.config Team do
edit do
field :division
@@ -394,7 +394,7 @@ class HelpTest < Tableless
should have_selector(".control-group", :count => 2)
end
- it "should delegates the label option to the ActiveModel API and memoize I18n awarly" do
+ it "delegates the label option to the ActiveModel API and memoize I18n awarly" do
RailsAdmin.config Team do
edit do
field :manager
@@ -411,7 +411,7 @@ class HelpTest < Tableless
I18n.locale = :en
end
- it "should be renameable" do
+ it "is renameable" do
RailsAdmin.config Team do
edit do
field :manager do
@@ -427,7 +427,7 @@ class HelpTest < Tableless
should have_selector("label", :text => "Name")
end
- it "should be renameable by type" do
+ it "is renameable by type" do
RailsAdmin.config Team do
edit do
fields_of_type :string do
@@ -451,7 +451,7 @@ class HelpTest < Tableless
should have_selector("label", :text => "Fans")
end
- it "should be globally renameable by type" do
+ it "is globally renameable by type" do
RailsAdmin.config Team do
edit do
fields_of_type :string do
@@ -475,7 +475,7 @@ class HelpTest < Tableless
should have_selector("label", :text => "Fans")
end
- it "should be flaggable as read only and be configurable with formatted_value" do
+ it "is flaggable as read only and be configurable with formatted_value" do
RailsAdmin.config Team do
edit do
field :name do
@@ -490,7 +490,7 @@ class HelpTest < Tableless
should have_content("I'm outputed in the form")
end
- it "should be hideable" do
+ it "is hideable" do
RailsAdmin.config Team do
edit do
field :manager do
@@ -506,7 +506,7 @@ class HelpTest < Tableless
should have_selector("#team_name")
end
- it "should be hideable by type" do
+ it "is hideable by type" do
RailsAdmin.config Team do
edit do
fields_of_type :string do
@@ -530,7 +530,7 @@ class HelpTest < Tableless
should have_selector("label", :text => "Fans")
end
- it "should be globally hideable by type" do
+ it "is globally hideable by type" do
RailsAdmin.config Team do
edit do
fields_of_type :string do
@@ -554,7 +554,7 @@ class HelpTest < Tableless
should have_selector("label", :text => "Fans")
end
- it "should have option to customize the help text" do
+ it "has option to customize the help text" do
RailsAdmin.config Team do
edit do
field :manager do
@@ -570,7 +570,7 @@ class HelpTest < Tableless
expect(find("#team_name_field .help-block")).not_to have_content("Additional help text")
end
- it "should have option to override required status" do
+ it "has option to override required status" do
RailsAdmin.config Team do
edit do
field :manager do
@@ -592,7 +592,7 @@ class HelpTest < Tableless
end
describe "bindings" do
- it "should be present at creation time" do
+ it "is present at creation time" do
RailsAdmin.config do |config|
config.excluded_models = []
end
@@ -615,7 +615,7 @@ class HelpTest < Tableless
end
describe "nested form" do
- it "should work" do
+ it "works" do
@record = FactoryGirl.create :field_test
@record.nested_field_tests = [NestedFieldTest.create!(:title => 'title 1'), NestedFieldTest.create!(:title => 'title 2')]
visit edit_path(:model_name => "field_test", :id => @record.id)
@@ -629,7 +629,7 @@ class HelpTest < Tableless
expect(@record.nested_field_tests[0].title).to eq('nested field test title 1 edited')
end
- it "should set bindings[:object] to nested object" do
+ it "sets bindings[:object] to nested object" do
RailsAdmin.config(NestedFieldTest) do
nested do
field :title do
@@ -645,7 +645,7 @@ class HelpTest < Tableless
expect(find('#field_test_nested_field_tests_attributes_0_title_field')).to have_content('NestedFieldTest')
end
- it "should be desactivable" do
+ it "is desactivable" do
visit new_path(:model_name => "field_test")
should have_selector('#field_test_nested_field_tests_attributes_field .add_nested_fields')
RailsAdmin.config(FieldTest) do
@@ -663,7 +663,7 @@ class HelpTest < Tableless
and_return({:allow_destroy=>true, :update_only=>false})
end
- it "should not show add button when :update_only is true" do
+ it "does not show add button when :update_only is true" do
FieldTest.nested_attributes_options.stub(:[]).with(:nested_field_tests).
and_return({:allow_destroy=>true, :update_only=>true})
visit new_path(:model_name => "field_test")
@@ -671,7 +671,7 @@ class HelpTest < Tableless
should_not have_selector('#field_test_nested_field_tests_attributes_field .add_nested_fields')
end
- it "should not show destroy button except for newly created when :allow_destroy is false" do
+ it "does not show destroy button except for newly created when :allow_destroy is false" do
@record = FieldTest.create
@record.nested_field_tests << NestedFieldTest.create!(:title => 'nested title 1')
FieldTest.nested_attributes_options.stub(:[]).with(:nested_field_tests).
@@ -684,7 +684,7 @@ class HelpTest < Tableless
end
describe "when a field which have the same name of nested_in field's" do
- it "should not hide fields which is not associated with nesting parent field's model" do
+ it "does not hide fields which is not associated with nesting parent field's model" do
visit new_path(:model_name => "field_test")
should_not have_selector('select#field_test_nested_field_tests_attributes_new_nested_field_tests_field_test_id')
should have_selector('select#field_test_nested_field_tests_attributes_new_nested_field_tests_another_field_test_id')
@@ -693,7 +693,7 @@ class HelpTest < Tableless
end
describe "embedded model", :mongoid => true do
- it "should work" do
+ it "works" do
@record = FactoryGirl.create :field_test
2.times.each{|i| @record.embeds.create :name => "embed #{i}"}
visit edit_path(:model_name => "field_test", :id => @record.id)
@@ -709,7 +709,7 @@ class HelpTest < Tableless
describe "fields which are nullable and have AR validations", :active_record => true do
- it "should be required" do
+ it "is required" do
# draft.notes is nullable and has no validation
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
expect(field.properties[:nullable?]).to be_true
@@ -737,12 +737,12 @@ class HelpTest < Tableless
describe "CKEditor Support" do
- it "should start with CKEditor disabled" do
+ it "starts with CKEditor disabled" do
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
expect(field.ckeditor).to be_false
end
- it "should add Javascript to enable CKEditor" do
+ it "adds Javascript to enable CKEditor" do
RailsAdmin.config Draft do
edit do
field :notes do
@@ -757,12 +757,12 @@ class HelpTest < Tableless
describe "CodeMirror Support" do
- it "should start with CodeMirror disabled" do
+ it "starts with CodeMirror disabled" do
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
expect(field.codemirror).to be_false
end
- it "should add Javascript to enable CodeMirror" do
+ it "adds Javascript to enable CodeMirror" do
RailsAdmin.config Draft do
edit do
field :notes do
@@ -777,12 +777,12 @@ class HelpTest < Tableless
describe "bootstrap_wysihtml5 Support" do
- it "should start with bootstrap_wysihtml5 disabled" do
+ it "starts with bootstrap_wysihtml5 disabled" do
field = RailsAdmin::config("Draft").edit.fields.find{|f| f.name == :notes}
expect(field.bootstrap_wysihtml5).to be_false
end
- it "should add Javascript to enable bootstrap_wysihtml5" do
+ it "adds Javascript to enable bootstrap_wysihtml5" do
RailsAdmin.config Draft do
edit do
field :notes do
@@ -797,7 +797,7 @@ class HelpTest < Tableless
describe "Paperclip Support" do
- it "should show a file upload field" do
+ it "shows a file upload field" do
RailsAdmin.config User do
edit do
field :avatar
@@ -828,7 +828,7 @@ def color_enum
Team.send(:remove_method, :color_enum)
end
- it "should auto-detect enumeration" do
+ it "auto-detects enumeration" do
should have_selector(".enum_type select")
should_not have_selector(".enum_type select[multiple]")
should have_content("green")
@@ -854,7 +854,7 @@ def color_enum
Team.instance_eval { undef :color_enum }
end
- it "should auto-detect enumeration" do
+ it "auto-detects enumeration" do
should have_selector(".enum_type select")
should have_content("green")
end
@@ -881,7 +881,7 @@ def color_list
Team.send(:remove_method, :color_list)
end
- it "should allow configuration" do
+ it "allows configuration" do
should have_selector(".enum_type select")
should have_content("green")
end
@@ -908,7 +908,7 @@ def color_list
Team.instance_eval { undef :color_list }
end
- it "should allow configuration" do
+ it "allows configuration" do
should have_selector(".enum_type select")
should have_content("green")
end
@@ -938,7 +938,7 @@ def color_list
Team.send(:remove_method, :color_list)
end
- it "should allow direct listing of enumeration options and override enum method" do
+ it "allows direct listing of enumeration options and override enum method" do
should have_selector(".enum_type select")
should have_no_content("green")
should have_content("yellow")
@@ -961,7 +961,7 @@ def color_enum
Team.instance_eval { undef :color_enum }
end
- it "should make enumeration multi-selectable" do
+ it "makes enumeration multi-selectable" do
should have_selector(".enum_type select[multiple]")
end
end
@@ -984,14 +984,14 @@ def color_enum
end
end
- it "should make enumeration multi-selectable" do
+ it "makes enumeration multi-selectable" do
should have_selector(".enum_type select[multiple]")
end
end
end
describe "ColorPicker Support" do
- it "should show input with class color" do
+ it "shows input with class color" do
RailsAdmin.config Team do
edit do
field :color, :color
View
56 spec/integration/config/list/rails_admin_config_list_spec.rb
@@ -5,7 +5,7 @@
subject { page }
describe "css hooks" do
- it "should be present" do
+ it "is present" do
RailsAdmin.config Team do
list do
field :name
@@ -28,7 +28,7 @@
end
end
- it "should be configurable per model" do
+ it "is configurable per model" do
RailsAdmin.config League do
list do
items_per_page 1
@@ -43,13 +43,13 @@
describe "items' fields" do
- it "should show all by default" do
+ it "shows all by default" do
visit index_path(:model_name => "fan")
expect(all("th").map(&:text).delete_if{|t| /^\n*$/ =~ t }).
to match_array ["Id", "Created at", "Updated at", "His Name", "Teams"]
end
- it "should hide some fields on demand with a block" do
+ it "hides some fields on demand with a block" do
RailsAdmin.config Fan do
list do
exclude_fields_if do
@@ -62,7 +62,7 @@
to match_array ["Id", "His Name", "Teams"]
end
- it "should hide some fields on demand with fields list" do
+ it "hides some fields on demand with fields list" do
RailsAdmin.config Fan do
list do
exclude_fields :created_at, :updated_at
@@ -73,7 +73,7 @@
to match_array ["Id", "His Name", "Teams"]
end
- it "should add some fields on demand with a block" do
+ it "adds some fields on demand with a block" do
RailsAdmin.config Fan do
list do
include_fields_if do
@@ -86,7 +86,7 @@
to match_array ["Id", "His Name", "Teams"]
end
- it "should show some fields on demand with fields list, respect ordering and configure them" do
+ it "shows some fields on demand with fields list, respect ordering and configure them" do
RailsAdmin.config Fan do
list do
fields :name, PK_COLUMN do
@@ -101,7 +101,7 @@
to match_array ["Modified Id", "Modified His Name"]
end
- it "should show all fields if asked" do
+ it "shows all fields if asked" do
RailsAdmin.config Fan do
list do
include_all_fields
@@ -114,7 +114,7 @@
to match_array ["Id", "Created at", "Updated at", "His Name", "Teams"]
end
- it "should appear in order defined" do
+ it "appears in order defined" do
RailsAdmin.config Fan do
list do
field :updated_at
@@ -128,7 +128,7 @@
to eq(["Updated at", "His Name", "Id", "Created at"])
end
- it "should only list the defined fields if some fields are defined" do
+ it "only lists the defined fields if some fields are defined" do
RailsAdmin.config Fan do
list do
field PK_COLUMN
@@ -141,7 +141,7 @@
should have_no_selector("th:nth-child(4).header")
end
- it "should delegate the label option to the ActiveModel API" do
+ it "delegates the label option to the ActiveModel API" do
RailsAdmin.config Fan do
list do
field :name
@@ -151,7 +151,7 @@
expect(find("th:nth-child(2)")).to have_content("His Name")
end
- it "should be renameable" do
+ it "is renameable" do
RailsAdmin.config Fan do
list do
field PK_COLUMN do
@@ -165,7 +165,7 @@
expect(find("th:nth-child(3)")).to have_content("His Name")
end
- it "should be renameable by type" do
+ it "is renameable by type" do
RailsAdmin.config Fan do
list do
fields_of_type :datetime do
@@ -178,7 +178,7 @@
to match_array ["Id", "Created at (datetime)", "Updated at (datetime)", "His Name", "Teams"]
end
- it "should be globally renameable by type" do
+ it "is globally renameable by type" do
RailsAdmin.config Fan do
list do
fields_of_type :datetime do
@@ -191,7 +191,7 @@
to match_array ["Id", "Created at (datetime)", "Updated at (datetime)", "His Name", "Teams"]
end
- it "should be sortable by default" do
+ it "is sortable by default" do
visit index_path(:model_name => "fan")
should have_selector("th:nth-child(2).header")
should have_selector("th:nth-child(3).header")