Get information about network on Ubuntu

nmcli dev list iface eth0 | grep IP4

or

mn-tool

Testing jQuery autocomplete with Capybara

  page.execute_script %Q{ $('"#{location}"').val('"#{text}"').keydown(); }
  sleep(3)
  page.execute_script %Q{ $('.ui-menu-item a:contains("#{target}")').trigger('mouseenter').click(); }
  page.should have_field(localtion, :with => completed_text)

rspec, machinist and database_cleaner

Configure

spec/spec_helper.rb

RSpec.configure do |config|
  config.use_transactional_fixtures = false
  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end
end

config/environments/test.rb

Machinist.configure do |config|
  config.cache_objects = false
end

cucumber on jruby

Configure gems

Add to Gemfile
"gem ‘gherkin’, :platform => :jruby" (with out quotes) just before cucumber gem

Precompile rails assets on jruby

Configure gems

Add to Gemfile
"gem 'therubyrhino', :platform => :jruby" (without quotes)