start fiingx failing cucumber scenario's and some small fixes

new capybara introduces some failing scenario's
This commit is contained in:
Reinier Balt 2012-12-23 23:16:22 +01:00
parent c8d2db6fc3
commit da2bee2e53
10 changed files with 42 additions and 19 deletions

10
Gemfile
View file

@ -3,7 +3,8 @@ source 'https://rubygems.org'
gem 'rails'
# you may comment out the database driver you will not be using.
# This will prevent a native build of the driver. Building native drivers is not always possible on all hosters
# This will prevent a native build of the driver. Building native drivers is not
# always possible on all hosters
gem "sqlite3"
gem "mysql2"
@ -54,10 +55,13 @@ end
group :test do
gem "factory_girl_rails"
gem "capybara"
gem "selenium-webdriver" # Note that > 2.14 has problems: https://code.google.com/p/selenium/issues/detail?id=3075
gem "database_cleaner"
gem "cucumber-rails", :require => false
gem "database_cleaner"
gem "aruba"
# Note that > 2.14 has problems, see:
# https://code.google.com/p/selenium/issues/detail?id=3075
gem "selenium-webdriver"
# uncomment to use the webkit option. This depends on Qt to be installed
#gem "capybara-webkit"

View file

@ -115,7 +115,7 @@ GEM
gem_plugin (~> 0.2.3)
multi_json (1.5.0)
mysql2 (0.3.11)
nokogiri (1.5.5)
nokogiri (1.5.6)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@ -152,7 +152,7 @@ GEM
rubyzip (0.9.9)
sanitize (2.0.3)
nokogiri (>= 1.4.4, < 1.6)
sass (3.2.3)
sass (3.2.4)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
@ -190,7 +190,7 @@ GEM
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
uniform_notifier (1.1.0)
websocket (1.0.4)
websocket (1.0.6)
will_paginate (3.0.3)
xpath (1.0.0)
nokogiri (~> 1.3)

View file

@ -3,6 +3,6 @@
<a href="https://github.com/TracksApp/tracks/wiki"><%= t('common.wiki')%></a> |
<a href="http://groups.google.com/group/TracksApp"><%= t('common.mailing_list')%></a> |
<a href="http://getontracks.org/"><%= t('common.website')%></a> |
<a href="http://getontracks.org/development/"><%= t('common.contribute')%></a></p>
<%= link_to(t('layouts.navigation.mobile'), todos_path(:format => 'm')) %>
<a href="http://getontracks.org/development/"><%= t('common.contribute')%></a> |
<%= link_to(t('layouts.navigation.mobile'), todos_path(:format => 'm')) %></p>
</div>

View file

@ -40,7 +40,7 @@ function add_todo_to_existing_context() {
<% unless source_view_is_one_of(:todo, :tag) && (@todo.deferred?||@todo.hidden?) -%>
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
$('#no_todos_in_view').slideUp(100);
<%= "$('#tickler-empty-nd').slideUp(100);" if source_view_is(:deferred) && @todo.deferred? %>
<%= "$('#tickler-empty-nd').slideUp(100);".html_safe if source_view_is(:deferred) && @todo.deferred? %>
<% end -%>
<% end -%>
$('#<%=empty_container_msg_div_id%>').hide();

View file

@ -72,7 +72,7 @@ function replace_todo(next_steps) {
function hide_context(next_steps) {
<% context_id = @context_changed ? @original_item_context_id : @todo.context_id -%>
$('#c<%= context_id %>').fadeOut(400, function(){ next_steps.go(); });
<%= "$('#tickler-empty-nd').slideDown(400);" if source_view_is(:deferred) && @down_count == 0 %>
<%= "$('#tickler-empty-nd').slideDown(400);".html_safe if source_view_is(:deferred) && @down_count == 0 %>
}
function highlight_updated_todo(next_steps) {

View file

@ -22,7 +22,7 @@ en:
api_docs: REST API Docs
feeds: Feeds
starred: Starred
notes_title: Show all notes
notes_title: View all notes
review_title: Make review
stats: Statistics
tickler_title: Tickler

View file

@ -86,7 +86,9 @@ When /^I edit the description of "([^"]*)" to "([^"]*)"$/ do |action_description
todo.should_not be_nil
open_edit_form_for(todo)
fill_in "todo_description", :with => new_description
within "form.edit_todo_form" do
fill_in "todo_description", :with => new_description
end
submit_edit_todo_form(todo)
end

View file

@ -1,5 +1,26 @@
module TracksStepHelper
def wait_until(timeout = 5)
timeout(timeout) { yield }
end
def timeout(seconds = 1, error_message = nil, &block)
start_time = Time.now
result = nil
until result
return result if result = yield
delay = seconds - (Time.now - start_time)
if delay <= 0
raise TimeoutError, error_message || "timed out"
end
sleep(0.05)
end
end
def open_edit_form_for(todo)
within "div#line_todo_#{todo.id}" do
find("a#icon_edit_todo_#{todo.id}").click

View file

@ -1,7 +1,7 @@
Feature: Show done
In order to see what I have completed
As an user
I want see my done todos
I want to see my done todos
Background:
Given the following user record

View file

@ -10,14 +10,10 @@ class DoneTodos
end
def self.done_this_week(todos, includes = {:include => Todo::DEFAULT_INCLUDES})
start_of_this_week = Time.zone.now.beginning_of_week
start_of_this_day = Time.zone.now.beginning_of_day
todos.completed_before(start_of_this_day).completed_after(start_of_this_week).all(includes)
todos.completed_before(Time.zone.now.beginning_of_day).completed_after(Time.zone.now.beginning_of_week).all(includes)
end
def self.done_this_month(todos, includes = {:include => Todo::DEFAULT_INCLUDES})
start_of_this_month = Time.zone.now.beginning_of_month
start_of_this_week = Time.zone.now.beginning_of_week
todos.completed_before(start_of_this_week).completed_after(start_of_this_month).all(includes)
todos.completed_before(Time.zone.now.beginning_of_week).completed_after(Time.zone.now.beginning_of_month).all(includes)
end
end