Sha256: 1b1e29dd5f85d6f3997bb75fe247695b953845360ff3f796db28b9c181973a5b

Contents?: true

Size: 1.35 KB

Versions: 56

Compression:

Stored size: 1.35 KB

Contents

describe "AMALayout.RealDatePicker", ->
  beforeEach ->
    this.fixtures = fixture.load("real_date_picker.html", false)
    jasmine.Ajax.install()
    new AMALayout.RealDatePicker()

  afterEach ->
    jasmine.Ajax.uninstall()

  describe "Initial state", ->
    it "Displays 31 days", ->
      available_days = $('select.day option')
      expect(available_days.length).toBe 31 + 1

  describe "Selecting a month with less than 31 days", ->
    beforeEach ->
      $('select.month').val(9)
      $('select.month').trigger('change')

    it "Displays 30 days", ->
      available_days = $('select.day option').filter -> $(@).css("display") isnt "none"
      expect(available_days.length).toBe 30 + 1

  describe "Selecting February in a leap year", ->
    beforeEach ->
      $('select.year').val(2000)
      $('select.month').val(2)
      $('select.month').trigger('change')

    it "Displays 29 days", ->
      available_days = $('select.day option').filter -> $(@).css("display") isnt "none"
      expect(available_days.length).toBe 29 + 1

  describe "Changing month with an invalid day already selected", ->
    beforeEach ->
      $('select.day').val(31)

    it "Resets day", ->
      expect($('select.day option:selected').val()).toBe "31"
      $('select.month').val(2)
      $('select.month').trigger('change')
      expect($('select.day option:selected').val()).toBe ""

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
ama_layout-11.5.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.5.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.4.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.3.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.3.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.2.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-11.1.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-10.2.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-10.1.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-10.0.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.5.3 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.5.2 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.5.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.5.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.4.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.4.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.3.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.2.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.1.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-9.0.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee