Module: LesliHelper

Defined in:
lib/rspec/helpers/lesli_helper.rb

Overview

This module is mainly used as common helpers needed through the Core or engines extracting functionalities that take long to develop so we prefer to use it like a RSpec module helper

Instance Method Summary collapse

Instance Method Details

#lesli_fixture_file(path) ⇒ FILE

RSpec.describe “POST:administration/account/files” do

subject(:file_example) { lesli_fixture_file("spec/fixtures/files/lesli-icon.png") }
it "..." do
    puts "/administration/account/files", params: { file: file_example }
end

end

Parameters:

  • path (String)

    the location of the file you want to load

Returns:

  • (FILE)

    image/JSON/HTML/CSV…



51
52
53
# File 'lib/rspec/helpers/lesli_helper.rb', line 51

def lesli_fixture_file path
    Rack::Test::UploadedFile.new(Rails.root.join(path))
end