require 'spec_helper'

describe 'destroy availability exceptions' do

  it 'should destroy availability_exception' do
    fixxpert = create :fixxpert, availability_defaults: "{\"0\":[\"25200\"],\"1\":[],\"2\":[],\"3\":[],\"4\":[],\"5\":[],\"6\":[]}"
    exception = create :availability_exception, fixxpert: fixxpert, date: '2020-07-05', data: "[\"25200\"]"

    login_as_user fixxpert
    click_link 'availability_settings_link'
    within '#availability_exceptions_list' do
      click_link 'Destroy'
    end
    page.should_not have_content '2020-07-05'
  end
end
