Skip to content

Commit

Permalink
adding fastclick, better person removal for tokenfield
Browse files Browse the repository at this point in the history
skipping specs where we send sms to admins
  • Loading branch information
cromulus committed May 15, 2016
1 parent 42af5f2 commit ebb1a0a
Show file tree
Hide file tree
Showing 4 changed files with 851 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//
//= require jquery
//= require jquery_ujs
//= require fastclick/fastclick
//= require best_in_place
//= require twitter/bootstrap
//= require twitter/typeahead.min
Expand All @@ -27,6 +28,7 @@
//= require_tree .

$(document).on('ready page:load',function() {
FastClick.attach(document.body);
/* Activating Best In Place */
jQuery(".best_in_place").best_in_place();

Expand Down
9 changes: 6 additions & 3 deletions app/assets/javascripts/tokenfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ $(document).on('ready page:load',function() {
var index = old_values.indexOf(e.attrs.id);
old_values.splice(index, 1);
$.unique(old_values);
$(hiddenInput).val(old_values.toString());
$.ajax('/v2/cart/delete/' + e.attrs.id);
$.ajax('/v2/cart/delete/' + e.attrs.id)
.done(function(){
// we successfully removed the person from the cart
$(hiddenInput).val(old_values.toString());
return true;
}).error(function(){return false;})
}
});

Expand All @@ -94,7 +98,6 @@ $(document).on('ready page:load',function() {
});
arr = $.map(arr,function(n){return parseInt(n)});
arr = $.unique(arr);
console.log(arr);
return arr;
}
}
Expand Down
2 changes: 2 additions & 0 deletions spec/controllers/v2/sms_reservations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
end

it 'sends out a confirmation sms for the admin user' do
skip('We do not send sms to admin users')
subject
open_last_text_message_for ENV['TWILIO_SCHEDULING_NUMBER']
expected = "A #{event_invitation.duration / 60} minute interview has been booked for #{selected_time}, with #{event.user.name}. \nTheir number is #{event.user.phone_number}\n. You'll get a reminder that morning."
Expand All @@ -68,6 +69,7 @@
end

it 'sends out a confirmation email for the admin user' do
skip('We do not send sms to admin users')
subject
open_last_text_message_for ENV['TWILIO_SCHEDULING_NUMBER']
expected = "#{research_subject.full_name} has declined the invitation for event #{event.id}. "
Expand Down
Loading

0 comments on commit ebb1a0a

Please sign in to comment.