Commit dd8386ce by Vijay Gawariya

add fixtures samples and test cases

parent 91e4c288
require "rails_helper"
RSpec.describe "file" do
describe 'Fixture file test case' do
it "reads sample file" do
fileData = file_fixture("example.txt").read;
# print fileData # print file Data
expect(fileData).to eq("Hello")
end
it "read sample image size" do
fileSize = file_fixture("vv.jpg").size;
# print fileSize # print file size
expect(fileSize).to eq(6457)
end
end
end
\ No newline at end of file
Hello
\ No newline at end of file
...@@ -35,6 +35,7 @@ end ...@@ -35,6 +35,7 @@ end
RSpec.configure do |config| RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures" config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.file_fixture_path = "spec/fixtures/files"
# If you're not using ActiveRecord, or you'd prefer not to run each of your # If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false # examples within a transaction, remove the following line or assign false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment