Skip to content

Instantly share code, notes, and snippets.

it "should return the average price" do
account = Factory(:account)
task1 = Factory(:simple_task, :identifier => 'image_moderation', :price => '0.1', :account => account)
task2 = Factory(:simple_task, :identifier => 'image_moderation', :price => '0.1', :account => account)
debugger
Task.average_task_price('image_moderation',account).should == 0.1
end
Feature: account features
As an account
I want to login with my credentials
So that I can navigate to the dashboard page
And check my task groups
Background:
Given an account exists with email: "[email protected]"
@wip @selenium
import Network.HTTP
import System.Timeout
main = do
rsp <- timeout 10000000 $ simpleHTTP $ getRequest "http://10.1.2.3/S"
case rsp of
Just rsp -> print $ show $ rsp
Nothing -> error "Nothing"
import Prelude hiding ( cycle )
import Control.Monad ( liftM )
cycle n c
| n == 1 = c
| odd n = cycle (3*n+1) c+1
| otherwise = cycle (div n 2) c+1
findMax i j = foldr (max . (`cycle` 1)) 0 [i..j]
source 'http://rubygems.org'
gem 'rails', '3.0.0.rc'
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
gem 'cancan', "1.3.2"
gem 'haml',"3.0.9"
group :production do
gem 'pg', "0.9.0"
$('input[autocomplete]').each(function(i){
$(this).autocomplete({
source: $(this).attr('autocomplete')
});
$(this).bind( "autocompleteselect", function(event, ui) {
log(ui.item ? (ui.item.value + " id: " + ui.item.id) : "Nothing selected, input was " + this.value);
});
});
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
gem 'cancan', "1.3.2"
gem 'haml',"3.0.9"
gem 'rails3-jquery-autocomplete', '>= 0.2.0'
group :production do
<body>
<div id="jqt" class="portrait">
<div class='current' id='home'>
<div class='toolbar'>
<h1>Refreshist</h1>
<%= link_to "Login", login_path, :class => "button slideup",:rel => "external" %>
</div>
<%= yield %>
</div>
</div>
class GetAssignmentJob < Struct.new(:hit)
def perform
AwsTurkAssignmentRequest.get_assignments_for_hit(hit)
end
end
observes :aws_turk_assignment_request, :after => :approveAssignment, :invokes => :approve_aws_assignment
def self.approve_aws_assignment(request)
Delayed::Job.enqueue(GetAssignmentJob.new(request.turk_assignment.hit), 0, 20.seconds.from_now)
end