File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module FixtureFileUploadSupport
7
7
private
8
8
9
9
def rails_fixture_file_wrapper
10
+ RailsFixtureFileWrapper . fixture_path = nil
10
11
resolved_fixture_path = ( fixture_path || RSpec . configuration . fixture_path || '' )
11
12
RailsFixtureFileWrapper . fixture_path = File . join ( resolved_fixture_path , '' ) unless resolved_fixture_path . strip . empty?
12
13
RailsFixtureFileWrapper . instance
Original file line number Diff line number Diff line change 3
3
module RSpec ::Rails
4
4
describe FixtureFileUploadSupport do
5
5
context 'with fixture path set in config' do
6
- before { RSpec . configuration . fixture_path = File . dirname ( __FILE__ ) }
7
-
8
6
it 'resolves fixture file' do
7
+ RSpec . configuration . fixture_path = File . dirname ( __FILE__ )
9
8
expect ( fixture_file_upload_resolved ( 'fixture_file_upload_support_spec.rb' ) . run ) . to be true
10
9
end
11
10
end
@@ -17,18 +16,17 @@ module RSpec::Rails
17
16
end
18
17
19
18
context 'with fixture path not set' do
20
- before { RSpec . configuration . fixture_path = nil }
21
-
22
- it 'resolves fixture with relative path' do
23
- expect ( fixture_file_upload_resolved ( 'fixture_file_upload_support_spec.rb' ) . run ) . to be true
19
+ it 'resolves fixture using relative path' do
20
+ RSpec . configuration . fixture_path = nil
21
+ expect ( fixture_file_upload_resolved ( 'spec/rspec/rails/fixture_file_upload_support_spec.rb' ) . run ) . to be true
24
22
end
25
23
end
26
24
27
25
def fixture_file_upload_resolved ( fixture_name , fixture_path = nil )
28
26
RSpec ::Core ::ExampleGroup . describe do
29
27
include RSpec ::Rails ::FixtureFileUploadSupport
30
28
31
- self . fixture_path = fixture_path if fixture_path
29
+ self . fixture_path = fixture_path
32
30
33
31
it 'supports fixture file upload' do
34
32
file = fixture_file_upload ( fixture_name )
You can’t perform that action at this time.
0 commit comments