Added selenium-webdrive to gemfile for javascript testing. Failed to get xhr or page.execute_script working for relationship controller tests. Used common matchers instead, not sure if they test the same functionality. Comments in code.