using should_receive with cucumber
Add this in your env.rb file:
require 'cucumber/rspec/doubles'
running tests for capybara webkit in a headless environment
sudo apt-get install xvfb
DISPLAY=localhost:1.0 xvfb-run rake spec
finding where a class file is defined
Get a handle on one of the methods:
m = YourClass.method(:some_method)
puts m.source_location
running rake tasks from the rails console
require "rake"
Your::Application.load_tasks
Rake::Task["some_task"].invoke # you'll also need reenable if calling a task multiple times
unknown provider eProvider
After minification, I received the error “unknown provider eProvider”. The solution was to switch from something like this:
controller: ($scope) ->
$scope.closeModal = ->
ModalService.close()
to something like this:
controller: ["$scope"
($scope) ->
$scope.closeModal = ->
ModalService.close()
]
I found the solution here
capybara checkbox
Here’s how you check a checkbox with capybara:
find("some_element").set(true)
swap panes in tmux
To swap panes in tmux, use this combination:
C-a C-o
Of course, it’s different if you don’t have C-a as your prefix.
getting rid of ubuntu menu
In case the Ubuntu menu cuts off your app’s menu ( had that happen with Eclipse ), you can start the app with the following setting:
UBUNTU_MENUPROXY= eclipse