This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In console: | |
# Ignores the setting up of Test::Unit by default | |
$ rails new app_name -T | |
# In Gemfile add the following gems: | |
group :test, :development do | |
gem 'turn' | |
gem 'rspec-rails' | |
gem 'capybara' | |
gem 'guard-rspec' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'resque/tasks' | |
namespace :ns do | |
desc "test task accepts param" | |
task :task, [:param] => [:environment] do |t,args| | |
abort "Please specify a param!" unless args[:param] | |
puts args[:param] | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :be_monotonically_increasing do | |
match do |actual| | |
derivative = actual.each_cons(2).map{|x, y| y <=> x} | |
derivative.all?{|v| v >= 0} | |
end | |
failure_message_for_should do |actual| | |
"expected array #{actual.inspect} to be monotonically increasing" | |
end |
To expose UDP service via NGINX, you need four things:
- Add port definition to DaemonSet (by default it only exposes
TCP/80
andTCP/443
) - Run your app
- Create a service exposing your app
- Add service definition to ConfigMap
udp-services
in theingress-nginx
namespace.