/*
 * Unit tests for the /asset endpoint.
 */

var
  restify = require("restify"),
  request = require("supertest"),
  connection = require("../src/connection"),
  connmocks = require("./mock/connection"),
  server = require("../src/server");

describe("assets", function() {
  var mocks;

  beforeEach(function () {
    mocks = connmocks.install(connection);
  });

  describe("#accept()", function() {
    it("accepts an asset file and produces a fingerprinted filename", function(done) {
      // shasum -a 256 test/fixtures/asset-file.txt
      var final_name =
        "https://example.com/fake/cdn/url/" +
        "asset-file-0a1b4ceeaee9f0b7325a5dbdb93497e1f8c98d03b6f2518084294faa3452efc1.txt";

      request(server.create())
        .post("/assets")
        .attach("first", "test/fixtures/asset-file.txt")
        .expect(200)
        .expect("Content-Type", /json/)
        .expect({ "asset-file.txt": final_name }, done);
    });
  });
});

@@ -364,47 +364,8 @@
 );%0A%0A
-  describe(%22#accept()%22, function() %7B%0A  
   it
@@ -449,18 +449,16 @@
 ) %7B%0A    
-  
 // shasu
@@ -495,18 +495,16 @@
 ile.txt%0A
-  
     var 
@@ -522,18 +522,16 @@
 =%0A      
-  
 %22https:/
@@ -560,18 +560,16 @@
 url/%22 +%0A
-  
       %22a
@@ -654,18 +654,16 @@
 %22;%0A%0A    
-  
 request(
@@ -679,18 +679,16 @@
 eate())%0A
-  
       .p
@@ -708,18 +708,16 @@
 )%0A      
-  
 .attach(
@@ -757,18 +757,16 @@
 e.txt%22)%0A
-  
       .e
@@ -774,34 +774,32 @@
 pect(200)%0A      
-  
 .expect(%22Content
@@ -814,18 +814,16 @@
 /json/)%0A
-  
       .e
@@ -873,16 +873,8 @@
 e);%0A
-    %7D);%0A
   %7D)

Remove unnecessary describe nesting.