Skip to content

Instantly share code, notes, and snippets.

View scottwillson's full-sized avatar

Scott Willson scottwillson

View GitHub Profile
@scottwillson
scottwillson / Tsung Rails authenticity_token
Created January 30, 2013 21:07
If you're using Tsung to test a Rails site that has CSRF protection, Tsung needs to parse the authenticity_token and submit it when POSTing. I could only find outdated examples. The snippet below works.
<request>
<dyn_variable name="authenticity_token" ></dyn_variable>
<http url="/registrations/new" version="1.1" method="GET"></http>
</request>
<request subst="true">
<http url="/registrations" method="POST" version="1.1"
contents="authenticity_token=%%_authenticity_token%%&amp;first_name=Jane"/>
</request>
def wait_until_visible(locator, seconds = 10)
raise ArgumentError if locator.blank?
begin
Timeout::timeout(seconds) do
until page.has_css?(locator) && find(locator).visible?
sleep 0.25
end
end
rescue Timeout::Error => e
diff --git a/test/unit/report/entertainment/deal_email_file_test.rb b/test/unit/report/entertainment/deal_email_file_test.rb
index 2089d2f..2f97681 100644
--- a/test/unit/report/entertainment/deal_email_file_test.rb
+++ b/test/unit/report/entertainment/deal_email_file_test.rb
@@ -1,10 +1,7 @@
require File.dirname(__FILE__) + "/../../../test_helper"
require File.dirname(__FILE__) + '/../entertainment_setup'
-module Report
- module Entertainment