@@ -23,6 +23,26 @@ def upload_file!(name, ext='csv')
2323 end
2424
2525
26+ context "with custom block" do
27+
28+
29+ before do
30+ add_author_resource ( { } ) do
31+ flash [ :notice ] = 'some custom message'
32+ end
33+ visit '/admin/authors/import'
34+
35+ end
36+
37+ it "should display notice from custom block" do
38+ upload_file! ( :author )
39+ expect ( page ) . to have_content "some custom message"
40+ end
41+
42+
43+
44+ end
45+
2646 context "with valid options" do
2747
2848 let ( :options ) { { } }
@@ -148,9 +168,9 @@ def upload_file!(name, ext='csv')
148168 context "with different header attribute names" do
149169
150170 let ( :options ) {
151- {
152- headers_rewrites : { :'Second name' => :last_name }
153- }
171+ {
172+ headers_rewrites : { :'Second name' => :last_name }
173+ }
154174 }
155175
156176 it "should import file" do
@@ -176,10 +196,10 @@ def upload_file!(name, ext='csv')
176196
177197 context "with callback procs options" do
178198 let ( :options ) { {
179- before_import : proc { |_ |} ,
180- after_import : proc { |_ |} ,
181- before_batch_import : proc { |_ |} ,
182- after_batch_import : proc { |_ |}
199+ before_import : proc { |_ |} ,
200+ after_import : proc { |_ |} ,
201+ before_batch_import : proc { |_ |} ,
202+ after_batch_import : proc { |_ |}
183203 } }
184204
185205
0 commit comments