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-8.0.2 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-8.0.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-8.0.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-7.0.2 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-7.0.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.12.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-7.0.pre spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.11.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-6.10.0.pre spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.10.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.9.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.8.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.7.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.6.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.5.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.4.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-6.3.0.pre spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.2.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.1.1 spec/ama_layout/javascripts/real_date_picker_spec.coffee
ama_layout-5.1.0 spec/ama_layout/javascripts/real_date_picker_spec.coffee