<commit_before>sinon = require 'sinon'
should = require 'should'

describe 'Client model: View', ->
  helper = require '../helper'
  helper.evalConcatenatedFile 'client/code/model/tool.coffee'
  helper.evalConcatenatedFile 'client/code/model/view.coffee'

  describe 'URL', ->
    beforeEach ->
      @tool = Cu.Model.Tool.findOrCreate
        name: 'test-plugin'
        displayName: 'Test Plugin'

      @view = Cu.Model.View.findOrCreate
        user: 'test'
        box: 'box1'
        tool: 'test-plugin'

    it 'has a related tool', ->
      tool = @view.get('tool')
      tool.get('displayName').should.equal 'Test Plugin'

class TestDb
  class Model
    constructor: (obj) ->
      for k of obj
        @[k] = obj[k]

    toObject: -> @

  save: (callback) ->
    callback null<commit_msg>Tools now have displayName in their manifest; fixed test.<commit_after>sinon = require 'sinon'
should = require 'should'

describe 'Client model: View', ->
  helper = require '../helper'
  helper.evalConcatenatedFile 'client/code/model/tool.coffee'
  helper.evalConcatenatedFile 'client/code/model/view.coffee'

  describe 'URL', ->
    beforeEach ->
      @tool = Cu.Model.Tool.findOrCreate
        name: 'test-plugin'
        manifest:
          displayName: 'Test Plugin'

      @view = Cu.Model.View.findOrCreate
        user: 'test'
        box: 'box1'
        tool: 'test-plugin'

    it 'has a related tool', ->
      tool = @view.get('tool')
      tool.get('manifest').displayName.should.equal 'Test Plugin'

class TestDb
  class Model
    constructor: (obj) ->
      for k of obj
        @[k] = obj[k]

    toObject: -> @

  save: (callback) ->
    callback null
{'fraction_non_alphanumeric': 0.13421210305572198, 'fraction_numerical': 0.0011983223487118035, 'mean_word_length': 2.538135593220339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2460374', 'n_tokens_mistral': 552, 'n_tokens_neox': 530, 'n_words': 132}