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
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 |
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
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 |
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
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" |
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
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] |
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
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" |
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
$('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); | |
}); | |
}); |
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
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 |
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
<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> |
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
class GetAssignmentJob < Struct.new(:hit) | |
def perform | |
AwsTurkAssignmentRequest.get_assignments_for_hit(hit) | |
end | |
end |
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
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 |