Sha256: a942b8baf808ca16bc15187bf94111c77790f23c33f0fd0c4456a8aa837599f2

Contents?: true

Size: 1.94 KB

Versions: 2

Compression:

Stored size: 1.94 KB

Contents

Feature: Handles proxied assets

  Scenario: Proxied assets can be renderable via Sprockets
    Given a fixture app "base-app"
    And a file named "config.rb" with:
      """
      proxy "assets/vendor/site.js", "vendor/site.js"

      activate :sprockets
      sprockets.append_path File.join(root, "source", "vendor")
      """
    And a file named "source/vendor/site.js" with:
      """
      alert("site.js");
      """
    And the Server is running

    When I go to "/assets/vendor/site.js"
    Then I should see 'alert("site.js");'

  Scenario: Proxied assets should be able to require files relative to their source
    Given a fixture app "base-app"
    And a file named "config.rb" with:
      """
      proxy "assets/vendor/site.js", "vendor/site.js"

      activate :sprockets
      sprockets.append_path File.join(root, "source", "vendor")
      """
    And a file named "source/vendor/_include.js" with:
      """
      console.log("include");
      """
    And a file named "source/vendor/site.js" with:
      """
      //= require "_include.js"
      """
    And the Server is running

    When I go to "/assets/vendor/site.js"
    Then I should see 'console.log("include");'

    When I go to "/vendor/site.js"
    Then I should see 'console.log("include");'


  Scenario: Proxied assets can ignore their source file
    Given a fixture app "base-app"
    And a file named "config.rb" with:
      """
      proxy "javascripts/site.js", "vendor/site.js", ignore: true

      activate :sprockets
      sprockets.append_path File.join(root, "source", "vendor")
      """
    And a file named "source/vendor/_include.js" with:
      """
      console.log("include");
      """
    And a file named "source/vendor/site.js" with:
      """
      //= require "_include.js"
      """
    And the Server is running

    When I go to "/javascripts/site.js"
    Then I should see 'console.log("include");'

    When I go to "/vendor/site.js"
    Then the status code should be "404"

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/middleman-sprockets-4.1.1/features/test_cases/proxy_asset.feature
middleman-sprockets-4.1.1 features/test_cases/proxy_asset.feature