私はテストしていますlib/pdf_helper.rb。だから私はspec/libディレクトリを作成します。次にpdf_helper_spec.rb、spec/libディレクトリにファイルを作成します。私はpdfフォルダーがパブリックフォルダーにある必要があることをテストしているので、ここに私のコードがあります
require 'spec_helper'
require 'pdf_helper'
describe "Pdfhelpers" do
it "Should be in public folder" do
file = File.new ("#{Rails.root}/public/pdf")
if File.exist?(file) == 'true'
puts "Success"
else
puts"failed"
end
end
end
私は正しいですか?? 私はRSpecが初めてです。