puts item.subject puts item.body end Sending an e-mail client.send_message(:subject => "Test subject", :body => "Test body", :to_recipients => ['some@person.tld']) Listing calendar events calendar = client.get_folder(:calendar) calendar.items.each...
p item.subject p item.required_attendees end Creating an appointment calendar.create_item(:subject => 'A test meeting', :start => Time.now) Creating a meeting and invite attendees Due to a bug in Viewpoint...
Large projects usually have large test suites that can run for a long time. This can be annoying as running tests blocks you from picking up the next story -- but...
...simply push that branch and check it out on your 2nd copy to run tests there. You can pick up a new story and work on that on your "main...
Possible Reason 1: parallel_tests - running more processes than features If you run old versions of parallel_tests with more processes than you have Cucumber features, you will get errors...
...The bug is fixed in versions 0.6.18+. Possible Reason 2: You are running parallel tests but you are using an (probably old) database.yml which is not setup for parallel tests...
...Locally or Prefetch Store in LocalStorage with Base64 Encoding Another Method Web Font Performance Tests Google Fonts Test Web Safe Font Test Local Fonts Test Third Party: Typekit Test
...paint or render of your text, so you can avoid FOIT. Remember to run tests for 3G connections as well because mobile users might have a worse experience as opposed...
...for the first time (bundle install, create database.yml, create databases, migrate), optionally run all tests (--test) or load a dump (--dump staging) update: update a Rails project that has been...
...open a shell on a Capistrano target, optionally selecting the server with --select-server tests: run all employed tests; checks for: Cucumber, RSpec, Test::Unit and rake with-firefox-for...
...your stubs, so it is always http://example.com/?foo[]=1&foo[]=2&foo[]=3. This might lead to green tests, but in fact crashes in real world. Rack::Utils.build_nested_query might help to build...
tl;dr: Always have your attachment path start with :rails_root/storage/#{Rails.env}#{ENV['RAILS_TEST_NUMBER']}/. The directory where you save your Paperclip attachments should not look like this: storage/photos/1...
...storage/attachments/1/... storage/attachments/2/... The problem with this is that multiple environments (at least development and test) will share the same directory structure. This will cause you pain eventually. Files will get...
...usually just want to print error messages), but it can be useful when writing tests. As an example, consider the following model which uses two validations on the email attribute...
...fast binstubs like bin/rails or bin/rspec which avoid Rails boot time. You want parallel_tests to speed up full test runs of large test suites. Unfortunately, you do not want...
...parallel_tests to use your Spring binstubs as those parallelized tests will share data and/or loose some information. There are some issues about this on GitHub and there is a...
...active class switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function...
...tool. This helps you to find out which parts of your application are not tested. Integrating this in a rails project with rspec, cucumber and parallel_tests is easy.
...it to your Gemfile and bundle group :test do gem 'simplecov', require: false end Add a .simplecov file in your project root: SimpleCov.start 'rails' do # any custom configs like groups...
...nick-invision/retry to re-try a failing command, optionally with a timeout: --- ... jobs: test: ... steps: - name: Run tests uses: nick-invision/retry@v2 with: timeout_seconds: 30 max_attempts...
...columns (you can debug issues better) As many parts of file processing are not tested (resolution, fallback images and many more), you need to know the application and make many...
Alltogether Deploy and run Part A (maybe takes some days) Before deployment of Part B Run Part A again (or maybe twice - depends on how long it runs...
Consider this class: class Foo private def test puts "Hello" end end While you can say create a block to call that method (using ampersand and colon) on Ruby...
...Foo.new.tap(&:test) Hello => # ... you cannot do that on Ruby 1.9 or 2.0: 1.9.3 > Foo.new.tap(&:test) NoMethodError: private method `test' called for # ^ 2.0.0 > Foo.new.tap(&:test) NoMethodError: private method `test' called for...
...behavior, not give you a safe string in the end (see below). Example def test(input) input.gsub /(f)/ do puts $1 'b' end end >> test('foo') f => "boo"
...provides a script to migrate your Ruby project automatically. Make sure your project has tests and you have a backup of your files (or pushed your commits to Git)
...is not perfect). Check the diff to see what the script has done. Run tests to see if everything still works...
...subsequent ESR releases overlap for three months. This way enterprises have a quarter to test the new version and migrate their clients...
...or when you accidentally interact with the browser frame. This will result in flickering tests, which are "randomly" red and green. In fact, this behavior is not random at all...
...better understanding of Selenium focus issues, and what you can do to get your test suite stable again. Preventing accidental interaction with the Selenium window When Selenium windows steal your...
...Specs with --backtrace option Run Cucumber features (with Geordi's --debug option) When all tests are green, look through your Gemfile and remove as many version constraints as possible.
Update rspec to '< 2' Lock haml to '= 3.1.7' Unlock andand Unlock rake Lock test-unit to '= 1.2.3' Lock database_cleaner to '< 1.3' Lock cucumber to '< 2'
Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you a new Cucumber tag @no_parallel which ensures that the...
...scenarios not tagged will @no_parallel can still run in parallel with the tagged test. Please read the previous sentence again. This can help when multiple test processes that access...
...Angular app employs uiRouter, although it is not used nor actually required for this test. Working test setup # Capitalized expressions are intended to be replaced with YOUR values describe 'SERVICE...
...httpBackend.verifyNoOutstandingExpectation() @$httpBackend.verifyNoOutstandingRequest() describe 'FUNCTION()', -> it 'does something', -> # Maybe some code here # Call function under test (triggers API request, which will be intercepted) @SERVICE.FUNCTION()
...do something before request is answered
...not to include 3 Applications Tip This can be used to test for exclusion of multiple values all at once...
You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work. Here is a solution for request specs, adapted from the Devise...
...wiki. We will simply use Warden's test helpers -- you probably already load them for your Cucumber tests. First, we define sign_in and sign_out methods. These will behave...
...to make it accessible from other machines in the local network, e.g. with a test iPad Improve geordi tests: If rake runs tests, skip other test runs (cucumber, rspec), as...
...rake usually runs all employed tests Rename geordi devserver to geordi server (the former is still supported) Improved command descriptions and README Fix geordi firefox --setup: Fail on missing version...