File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -36,3 +36,21 @@ Feature: Using `file_fixture`
36
36
"""
37
37
When I run `rspec spec/lib/file_spec.rb`
38
38
Then the examples should all pass
39
+
40
+ Scenario : Creating a ActiveStorage::Blob from a file fixture
41
+ Given a file named "spec/fixtures/files/sample.txt" with:
42
+ """
43
+ Hello
44
+ """
45
+ And a file named "spec/lib/fixture_set_blob.rb" with:
46
+ """ruby
47
+ require "rails_helper"
48
+
49
+ RSpec.describe "blob" do
50
+ it "creates a blob from a sample file" do
51
+ expect(ActiveStorage::FixtureSet.blob(filename: "sample.txt")).to include("sample.txt")
52
+ end
53
+ end
54
+ """
55
+ When I run `rspec spec/lib/fixture_set_blob.rb`
56
+ Then the examples should all pass
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ module FileFixtureSupport
9
9
10
10
included do
11
11
self . file_fixture_path = RSpec . configuration . file_fixture_path
12
+ if defined? ActiveStorage ::FixtureSet
13
+ ActiveStorage ::FixtureSet . file_fixture_path = RSpec . configuration . file_fixture_path
14
+ end
12
15
end
13
16
end
14
17
end
You can’t perform that action at this time.
0 commit comments