Permalink
Browse files

Final Tests and cleanup

  • Loading branch information...
1 parent c947e80 commit ecb107764a905c09bf6f8784026a0452df231528 Dipil committed Apr 15, 2011
@@ -42,7 +42,7 @@ def purchase_points
current_user.points += params[:points].to_f
if current_user.save
flash[:notice] = "#{params[:points]} points added"
- current_user.microtasks.first.log_entries.create(:message => "#{params[:points]} Points Purchased", :user_id => current_user.id)
+ LogEntry.create(:message => "#{params[:points]} Points Purchased", :user_id => current_user.id)
redirect_to user_root_path
else
flash[:notice] = "Your points cannot be been added"
View
@@ -7,6 +7,7 @@ def log_entries
self.microtasks.each do |microtask|
log_entries << microtask.log_entries
end
+ log_entries << LogEntry.where(:user_id => self.id).where('message like ?', "% Points Purchased").all
log_entries.flatten.sort! {|x,y| y.created_at <=> x.created_at }
end
@@ -1,9 +1,17 @@
%div#faded
%ul.slides
%li
+ %div#sentence
+ " Lost In Translation ? "
+ %div#message
+ Get Accurate Translations from Real People
= image_tag("requester_home.png")
= link_to("<span><span>Sign Up</span></span>".html_safe, new_user_registration_path(:user_type => "Requester") )
%li
+ %div#sentence
+ " Earn Easy Money ! "
+ %div#message
+ No Experience or Qualifications Needed
= image_tag("translator_home.png")
= link_to("<span><span>Sign Up</span></span>".html_safe, new_user_registration_path(:user_type => "Translator") )
%ul.pagination
@@ -1,35 +0,0 @@
-.inside.bot-indent
- = render :partial => "shared/slogan", :locals => { :h2span => "Welcome", |
- :h2 => current_user.name, |
- :p => "Remaining Points: #{current_user.points.round(2)} #{link_to("Purchase More", purchase_points_path, :remote => true)}" |
- } |
- %h2.extra
- My Current Tasks #{link_to "Request New Translation ", new_task_path}
- .box.extra
- .left-indent.line-ver1
- %article.col-1.indent
- %h4.aligncenter Title
- %ul.info-list1
- - @tasks.each do |task|
- %li= link_to task.title, task_path(task)
- %article.col-2.indent
- %h4.aligncenter From
- %ul.info-list1.alt
- - @tasks.each do |task|
- %li= task.get_language_from.name
- %article.col-3.indent
- %h4.aligncenter To
- %ul.info-list1.alt
- - @tasks.each do |task|
- %li= task.get_language_to.name
- %article.col-4.indent
- %h4.aligncenter Deadline
- %ul.info-list1.alt
- - @tasks.each do |task|
- %li= task.deadline.to_date
- %article.col-5.indent
- %h4.aligncenter Completed
- %ul.info-list1.alt
- - @tasks.each do |task|
- %li= "#{task.completed} %"
- .clear
@@ -1,44 +0,0 @@
-!!!
-%html
- %head
- %title TranslateTxt
- = stylesheet_link_tag :all
- = javascript_include_tag 'jquery', 'jquery-ui-1.8.11.custom.min', 'cufon-yui', 'cufon-replace', 'jquery.faded', 'jquery.jqtransform', 'script', 'Myriad_Pro_300.font', 'Myriad_Pro_400.font', 'rails', 'application'
- = csrf_meta_tag
- :javascript
- $(function(){
- $("#faded").faded({
- speed: 500,
- crossfade: true,
- autoplay: 4000,
- autopagination:false
- });
-
- $('#domain-form').jqTransform({imgPath:'jqtransformplugin/img/'});
- });
- %body#page1
- .tail-top
- / header
- %header
- .container
- .header-box
- .left
- .right
- %h1
- - if user_signed_in?
- = link_to "<span>Translate</span>Text".html_safe, user_root_path
- - else
- = link_to "<span>Translate</span>Text".html_safe, :root
- = render "shared/login_links"
- / content
- %section#content
- .container
- %p.notice= notice
- %p.alert= alert
- = yield
- / footer
- %footer
- .container
- .inside
- Copyright 2011 #{link_to("Translate Text", "#")} Sprout Technologies
- %br/
@@ -24,17 +24,17 @@ Feature: Manage requester_tasks
And I am on the user_root page
When I follow "Nepali Translation"
Then I should see "paragraphs"
- And I should see "Paragraph 1"
- And I should see "Paragraph 2"
- And I should see "Paragraph 3"
+ And I should see "Paragraph1"
+ And I should see "Paragraph2"
+ And I should see "Paragraph3"
+ @javascript
Scenario: Purchase points
Given I should see "Remaining Points: 1000.0"
And I follow "Purchase More"
And I fill in "Points" with "100"
And I press "Purchase"
- Then I should see "100 points added"
- And I should see "Remaining Points: 1100.0"
+ Then I should see "Remaining Points: 1100.0"
Scenario: Check requester points during task creation
Given a language "English" exists
@@ -13,7 +13,6 @@ Feature: Manage signups
And I press "Sign up"
Then 1 requester should exist
- @javascript
Scenario: Sign In
Given I am not Authenticated
And I am on the root page
@@ -398,5 +398,20 @@ div.pagination_log {
#faded ul.slides li img {
position: absolute;
top: 1px;
- right: 200px;
+ right: 400px;
}
+
+#sentence {
+ margin-left: 600px;
+ margin-top: 80px;
+ font-size: 35px;
+ font-family: cursive;
+}
+
+#message {
+ margin-left: 625px;
+ margin-top: 50px;
+ font-size: 18px;
+ font-family: cursive;
+}
+
@@ -1,5 +1,6 @@
require 'spec_helper'
describe LogEntry do
- pending "add some examples to (or delete) #{__FILE__}"
+ it { should belong_to :user }
+ it { should belong_to :microtask }
end

0 comments on commit ecb1077

Please sign in to comment.