Sha256: ec5f92ff67bf5a1f64f6a20b2add681b1dacc38920851c19e5278a96e4f01e01

Contents?: true

Size: 494 Bytes

Versions: 6

Compression:

Stored size: 494 Bytes

Contents

module Features
  module FixtureFileUpload
    # Can't just call this fixture_file_upload due to name conflicts.
    def worthwhile_fixture_file_upload(path, content_type = 'text/plain', binary = false)
      Rack::Test::UploadedFile.new(fixture_file_path(path), content_type, binary)
    end
    def fixture_file(path)
      File.open(fixture_file_path(path))
    end
    def fixture_file_path(path)      
      File.join(Worthwhile::Engine.root.to_s, 'spec/fixtures', path)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 spec/support/features/fixture_file_upload.rb
worthwhile-0.1.1 spec/support/features/fixture_file_upload.rb
worthwhile-0.1.0 spec/support/features/fixture_file_upload.rb
worthwhile-0.0.3 spec/support/features/fixture_file_upload.rb
worthwhile-0.0.2 spec/support/features/fixture_file_upload.rb
worthwhile-0.0.1 spec/support/features/fixture_file_upload.rb