File tree Expand file tree Collapse file tree 5 files changed +20
-3
lines changed
Expand file tree Collapse file tree 5 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1212 failed :
1313 one : " Failed to import 1 %{model}"
1414 other : " Failed to import %{count} %{plural_model}"
15- import_model : " Import %{model }"
15+ import_model : " Import %{plural_model }"
1616 import_btn : " Import"
1717 import_btn_disabled : " Wait..."
Original file line number Diff line number Diff line change 1212 failed :
1313 one : " Importazione di 1 %{model} fallita"
1414 other : " Importazione di %{count} %{plural_model} fallita"
15- import_model : " Importa %{model }"
15+ import_model : " Importa %{plural_model }"
1616 import_btn : " Importa"
1717 import_btn_disabled : " In attesa..."
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def active_admin_import(options = {}, &block)
4949
5050 action_item :import , only : :index do
5151 if authorized? ( ActiveAdminImport ::Auth ::IMPORT , active_admin_config . resource_class )
52- link_to ( I18n . t ( 'active_admin_import.import_model' , model : options [ :resource_label ] ) , action : :import )
52+ link_to ( I18n . t ( 'active_admin_import.import_model' , plural_model : options [ :plural_resource_label ] ) , action : :import )
5353 end
5454 end
5555
Original file line number Diff line number Diff line change @@ -22,6 +22,22 @@ def upload_file!(name, ext='csv')
2222 find_button ( 'Import' ) . click
2323 end
2424
25+ context "authors index" do
26+ before do
27+ add_author_resource
28+
29+ end
30+
31+ it "should navigate to import page" do
32+ #todo: removing this causes undefined method `ransack' for #<ActiveRecord::Relation []>
33+ allow_any_instance_of ( Admin ::AuthorsController ) . to receive ( :find_collection ) . and_return ( Author . all )
34+ visit '/admin/authors'
35+ find_link ( 'Import Authors' ) . click
36+ expect ( current_path ) . to eq ( "/admin/authors/import" )
37+ end
38+
39+
40+ end
2541
2642 context "with custom block" do
2743
Original file line number Diff line number Diff line change 11def add_author_resource ( options = { } , &block )
22
33 ActiveAdmin . register Author do
4+ config . filters = false
45 active_admin_import ( options , &block )
56 end
67 Rails . application . reload_routes!
You can’t perform that action at this time.
0 commit comments