Cucumber fixes

* Use correct locale for testing
* Global namespace refs
pull/3382/head
Oliver Günther 9 years ago
parent 2f360c3413
commit 988c9f38a7
  1. 2
      app/controllers/work_packages/moves_controller.rb
  2. 4
      features/step_definitions/general_steps.rb
  3. 4
      features/step_definitions/timelines_comparison_steps.rb
  4. 8
      features/support/env.rb
  5. 4
      features/support/login_steps.rb

@ -100,7 +100,7 @@ class WorkPackages::MovesController < ApplicationController
private
def prepare_for_work_package_move
@work_packages.sort!
@work_packages = @work_packages.sort
@copy = params.has_key? :copy
@allowed_projects = WorkPackage.allowed_target_projects_on_move(current_user)
@target_project = @allowed_projects.detect { |p| p.id.to_s == params[:new_project_id].to_s } if params[:new_project_id]

@ -90,11 +90,7 @@ Given /^(?:|I )am (not )?impaired$/ do |bool|
end
Given /^there is 1 [pP]roject with(?: the following)?:$/ do |table|
standard_type = FactoryGirl.build(:type_standard)
p = FactoryGirl.build(:project)
p.types << standard_type
send_table_to_object(p, table)
end

@ -64,7 +64,7 @@ Given(/^there are the following work packages were added "(.*?)"(?: in project "
else
target_time = Time.now
end
Timecop.freeze(target_time) do
::Timecop.freeze(target_time) do
create_work_packages_from_table table, project
end
end
@ -84,7 +84,7 @@ Given(/^the work package "(.*?)" was changed "(.*?)" to:$/) do |name, time, tabl
target_time = Time.now
end
Timecop.freeze(target_time) do
::Timecop.freeze(target_time) do
timeline = WorkPackage.find_by(subject: name)
table.hashes.first.each do |key, value|
timeline[key] = value

@ -67,7 +67,13 @@ Capybara.register_driver :selenium do |app|
require 'selenium/webdriver'
Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] ||
Selenium::WebDriver::Firefox::Binary.path
Capybara::Selenium::Driver.new(app, browser: :firefox)
profile = Selenium::WebDriver::Firefox::Profile.new
profile['intl.accept_languages'] = 'en,en-us'
Capybara::Selenium::Driver.new(app,
browser: :firefox,
profile: profile)
end
# By default, any exception happening in your Rails application will bubble up

@ -32,8 +32,8 @@ module LoginSteps
# visit '/logout' # uncomment me if needed
visit '/login'
within('#login-form') do
fill_in User.human_attribute_name(:login), with: login
fill_in 'Password', with: password
fill_in 'username', with: login
fill_in 'password', with: password
click_button translate('t:button_login')
end
end

Loading…
Cancel
Save