mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
fix failing cucumber scenario's and update gems
This commit is contained in:
parent
5164c404db
commit
bbf6cdf702
8 changed files with 32 additions and 24 deletions
|
@ -57,7 +57,7 @@ GEM
|
|||
xpath (~> 2.0)
|
||||
childprocess (0.3.9)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
codeclimate-test-reporter (0.0.8)
|
||||
codeclimate-test-reporter (0.0.9)
|
||||
simplecov (>= 0.7.1, < 1.0.0)
|
||||
coffee-rails (4.0.0)
|
||||
coffee-script (>= 2.2.0)
|
||||
|
@ -137,7 +137,7 @@ GEM
|
|||
rspec-expectations (2.14.2)
|
||||
diff-lcs (>= 1.1.3, < 2.0)
|
||||
rubyzip (0.9.9)
|
||||
safe_yaml (0.9.5)
|
||||
safe_yaml (0.9.7)
|
||||
sanitize (2.0.6)
|
||||
nokogiri (>= 1.4.4)
|
||||
sass (3.2.10)
|
||||
|
|
|
@ -136,8 +136,8 @@ class ProjectsController < ApplicationController
|
|||
limit(current_user.prefs.show_number_completed).
|
||||
includes(Todo::DEFAULT_INCLUDES) unless @max_completed == 0
|
||||
|
||||
@count = @not_done_todos.size
|
||||
@down_count = @count + @deferred_todos.size + @pending_todos.size
|
||||
@down_count = @not_done_todos.size + @deferred_todos.size + @pending_todos.size
|
||||
@count=@down_count
|
||||
@next_project = current_user.projects.next_from(@project)
|
||||
@previous_project = current_user.projects.previous_from(@project)
|
||||
@default_tags = @project.default_tags
|
||||
|
|
|
@ -123,6 +123,8 @@ class TodosController < ApplicationController
|
|||
determine_down_count
|
||||
@contexts = current_user.contexts
|
||||
@projects = current_user.projects
|
||||
@context = @todo.context
|
||||
@project = @todo.project
|
||||
@initial_context_name = params['default_context_name']
|
||||
@initial_project_name = params['default_project_name']
|
||||
@initial_tags = params['initial_tag_list']
|
||||
|
@ -1163,18 +1165,18 @@ end
|
|||
def update_context
|
||||
@context_changed = false
|
||||
if params['todo']['context_id'].blank? && params['context_name'].present?
|
||||
context = current_user.contexts.where(:name => params['context_name'].strip).first
|
||||
unless context
|
||||
@context = current_user.contexts.where(:name => params['context_name'].strip).first
|
||||
if @context.nil?
|
||||
@new_context = current_user.contexts.build
|
||||
@new_context.name = params['context_name'].strip
|
||||
@new_context.save
|
||||
@new_context_created = true
|
||||
@new_container = @new_context
|
||||
@not_done_todos = [@todo]
|
||||
context = @new_context
|
||||
@context = @new_context
|
||||
end
|
||||
params["todo"]["context_id"] = context.id
|
||||
@context_changed = @original_item_context_id != params["todo"]["context_id"] = context.id
|
||||
params["todo"]["context_id"] = @context.id
|
||||
@context_changed = @original_item_context_id != params["todo"]["context_id"] = @context.id
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -575,6 +575,13 @@ module TodosHelper
|
|||
return false
|
||||
end
|
||||
|
||||
def should_show_empty_container
|
||||
source_view do |page|
|
||||
page.context { return @remaining_in_context == 0 }
|
||||
end
|
||||
return @down_count==0
|
||||
end
|
||||
|
||||
def project_container_id(todo)
|
||||
return "p#{todo.project_id}" unless todo.project.nil?
|
||||
return "without_project_container"
|
||||
|
|
|
@ -42,7 +42,7 @@ function remove_todo(next_steps) {
|
|||
|
||||
function add_to_existing_container(next_steps) {
|
||||
$('#<%= item_container_id(@todo) %>_items').append(html_for_todo());
|
||||
<% if source_view_is_one_of(:project,:calendar) -%>
|
||||
<% if source_view_is_one_of(:calendar) -%>
|
||||
next_steps.go();
|
||||
<% if (@target_context_count==1) || ( (@todo.deferred? || @todo.pending?) && @remaining_deferred_or_pending_count == 1) -%>
|
||||
$("#<%= empty_container_msg_div_id %>").slideUp(100);
|
||||
|
@ -83,7 +83,7 @@ function highlight_updated_todo(next_steps) {
|
|||
}
|
||||
|
||||
function update_empty_container(next_steps) {
|
||||
<% if @down_count==0 -%>
|
||||
<% if should_show_empty_container -%>
|
||||
$('div#no_todos_in_view').slideDown(400, function(){ next_steps.go(); });
|
||||
<% else -%>
|
||||
$('div#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); });
|
||||
|
|
|
@ -12,17 +12,16 @@ Feature: Edit a context
|
|||
And I have a project called "test project"
|
||||
And I have 2 todos in project "test project" in context "@pc" with tags "starred" prefixed by "test_project "
|
||||
|
||||
@javascript
|
||||
@javascript
|
||||
Scenario: In place edit of context name
|
||||
Given I have a context called "Errands"
|
||||
When I go to the context page for "Errands"
|
||||
When I go to the context page for "@pc"
|
||||
And I edit the context name in place to be "OutAndAbout"
|
||||
Then I should see the context name is "OutAndAbout"
|
||||
When I go to the contexts page
|
||||
Then I should see that a context named "Errands" is not present
|
||||
And I should see that a context named "OutAndAbout" is present
|
||||
|
||||
@javascript
|
||||
@javascript
|
||||
Scenario: Editing the context of a todo will remove the todo
|
||||
When I go to the the context page for "@pc"
|
||||
Then the badge should show 2
|
||||
|
@ -37,7 +36,7 @@ Feature: Edit a context
|
|||
Then I should not see the todo "test_project todo 1"
|
||||
And I should see "changed"
|
||||
|
||||
@javascript
|
||||
@javascript
|
||||
Scenario: Editing the context of the last todo will remove the todo and show empty message
|
||||
When I go to the the context page for "@pc"
|
||||
And I edit the context of "test_project todo 1" to "@laptop"
|
||||
|
|
|
@ -45,7 +45,7 @@ end
|
|||
#
|
||||
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
||||
# # { :except => [:widgets] } may not do what you expect here
|
||||
# # as tCucumber::Rails::Database.javascript_strategy overrides
|
||||
# # as Cucumber::Rails::Database.javascript_strategy overrides
|
||||
# # this setting.
|
||||
# DatabaseCleaner.strategy = :truncation
|
||||
# end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
||||
# It is recommended to regenerate this file in the future when you upgrade to a
|
||||
# newer version of cucumber-rails. Consider adding your own code to a new file
|
||||
# It is recommended to regenerate this file in the future when you upgrade to a
|
||||
# newer version of cucumber-rails. Consider adding your own code to a new file
|
||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
||||
# files.
|
||||
|
||||
|
@ -14,19 +14,19 @@ begin
|
|||
require 'cucumber/rake/task'
|
||||
|
||||
namespace :cucumber do
|
||||
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
||||
Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
|
||||
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
||||
t.fork = true # You may get faster startup if you set this to false
|
||||
t.profile = 'default'
|
||||
end
|
||||
|
||||
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
||||
Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t|
|
||||
t.binary = vendored_cucumber_bin
|
||||
t.fork = true # You may get faster startup if you set this to false
|
||||
t.profile = 'wip'
|
||||
end
|
||||
|
||||
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
||||
Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
||||
t.binary = vendored_cucumber_bin
|
||||
t.fork = true # You may get faster startup if you set this to false
|
||||
t.profile = 'rerun'
|
||||
|
@ -50,8 +50,8 @@ begin
|
|||
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
||||
end
|
||||
|
||||
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
||||
task 'db:test:prepare' do
|
||||
# In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
|
||||
task 'test:prepare' do
|
||||
end
|
||||
|
||||
task :stats => 'cucumber:statsetup'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue