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
| # ref: http://37signals.com/svn/posts/3004-ab-testing-tech-note-determining-sample-size | |
| # | |
| # p1 = Variable A results. e.g. conversion rate from test A | |
| # p2 = Variable B results | |
| # power = chance of false negative (A power of 0.80 means that there is an 80% chance that if there was an effect, we would detect it ) | |
| # sig.level = chance of false positive (0.05 = 5%) | |
| power.prop.test(p1=0.1, p2=0.11, power=0.8, alternative='two.sided', sig.level=0.05) | |
| # Output will be a number signifying minimal sample size that meets the above criteria |
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
| # More info at https://github.com/guard/guard#readme | |
| # Instructions: | |
| # 1) gem install guard guard-shell | |
| # 2) run guard in root | |
| # run test with 'redgreen' gem(for colour) if available otherwise with plain ruby | |
| guard "shell" do | |
| watch(%r{^(.+)/.+\.rb$}) do |m| | |
| if File.exists?("#{m[1]}/#{m[1]}_test.rb") |
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
| def within_list(css_class) | |
| css_selector = css_class.gsub(/ /, '.') #stack the css classes for selection | |
| list = current_dom.at("ol.#{css_selector}") || current_dom.at("ul.#{css_selector}") # Could add an opt param to the method to make this explicit - for now we don't care | |
| assert_not_nil(list, "Expected to find a ul or li tag matching the css class '#{css_class}'") | |
| yield list | |
| end | |
| Then /^I should see the text "(.*)" in the "(.*)" list$/ do |text, css_class| #" | |
| within_list(css_class) do |list| | |
| matching_list_items = list.search("li").select{ |li| strip_html_tags_from(li.inner_html) =~ escape_text_for_regexp(text) } |
NewerOlder