Sha256: 6c72dc8a04c58616918653118b4773d15328a7beb39662a0c4a3f9c4895c1328

Contents?: true

Size: 990 Bytes

Versions: 33

Compression:

Stored size: 990 Bytes

Contents

describe "Quby.Models.Flag", ->
  beforeEach ->
    @flag = new Quby.Models.Flag(
      key: 'testkey'
      hidesQuestionsKeys: ["v_1"]
      showsQuestionsKeys: ["v_2"]
    )
    @v_1 = new Quby.Models.Question(key: "v_1")
    @v_2 = new Quby.Models.Question(key: "v_2")
    @questions = new Quby.Collections.Questions([@v_1, @v_2])

  describe "#initShowsHides", ->
    it 'looks up the hidesQuestionsKeys in the question collection to initialize the hidesQuestions collection', ->
      @flag.initShowsHides(@questions)
      @flag.get("hidesQuestions").should == new Quby.Collections.Questions([@v_1])
    it 'looks up the showsQuestionsKeys in the question collection to initialize the showsQuestions collection', ->
      @flag.initShowsHides(@questions)
      @flag.get("showsQuestions").should == new Quby.Collections.Questions([@v_2])
    it 'calls doHiding', ->
      spy = sinon.spy(@flag, 'doHiding')
      @flag.initShowsHides(@questions)
      expect(spy).toHaveBeenCalled()

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
quby-5.6.5 spec/javascripts/flag_spec.coffee
quby-5.6.3 spec/javascripts/flag_spec.coffee
quby-5.6.2 spec/javascripts/flag_spec.coffee
quby-5.6.1 spec/javascripts/flag_spec.coffee
quby-5.6.0 spec/javascripts/flag_spec.coffee
quby-5.5.0 spec/javascripts/flag_spec.coffee
quby-5.4.0 spec/javascripts/flag_spec.coffee
quby-5.3.1 spec/javascripts/flag_spec.coffee
quby-5.3.0 spec/javascripts/flag_spec.coffee
quby-5.2.0 spec/javascripts/flag_spec.coffee
quby-5.1.3 spec/javascripts/flag_spec.coffee
quby-5.1.2 spec/javascripts/flag_spec.coffee
quby-5.1.1 spec/javascripts/flag_spec.coffee
quby-5.1.0 spec/javascripts/flag_spec.coffee
quby-5.0.5 spec/javascripts/flag_spec.coffee
quby-5.0.4 spec/javascripts/flag_spec.coffee
quby-5.0.3 spec/javascripts/flag_spec.coffee
quby-5.0.2 spec/javascripts/flag_spec.coffee
quby-5.0.1 spec/javascripts/flag_spec.coffee
quby-5.0.0 spec/javascripts/flag_spec.coffee