diff --git a/.travis.yml b/.travis.yml index 65314ef..76757f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ env: - TASK=test:units - TASK=test:functionals - TASK=test:integration - - TASK=cucumber + - TASK=cucumber LANG=en - TASK=selenium - TASK=test:noosfero_plugins diff --git a/app/controllers/public/enterprise_registration_controller.rb b/app/controllers/public/enterprise_registration_controller.rb index ac048d0..7b58c57 100644 --- a/app/controllers/public/enterprise_registration_controller.rb +++ b/app/controllers/public/enterprise_registration_controller.rb @@ -4,7 +4,7 @@ class EnterpriseRegistrationController < ApplicationController before_filter :login_required # Just go to the first step. - # + # # FIXME: shouldn't this action present some sort of welcome message and point # to the first step explicitly? def index @@ -15,7 +15,7 @@ class EnterpriseRegistrationController < ApplicationController @create_enterprise.target = Profile.find(params[:create_enterprise][:target_id]) end elsif @validation == :admin || @validation == :none - @create_enterprise.target = environment + @create_enterprise.target = environment end @create_enterprise.requestor = user the_action = @@ -40,7 +40,7 @@ class EnterpriseRegistrationController < ApplicationController protected - # Fill in the form and select your Region. + # Fill in the form and select your Region. # # Posts back. def basic_information diff --git a/app/models/create_enterprise.rb b/app/models/create_enterprise.rb index 18a2f1f..9a74adc 100644 --- a/app/models/create_enterprise.rb +++ b/app/models/create_enterprise.rb @@ -22,7 +22,7 @@ class CreateEnterprise < Task #checks if the validation method is region to validates validates_presence_of :region_id, :if => lambda { |obj| obj.environment.organization_approval_method == :region } - validates_numericality_of :foundation_year, only_integer: true, allow_nil: true + validates_numericality_of :foundation_year, only_integer: true, if: -> o { o.foundation_year.present? } # checks for actual attributes validates_presence_of :requestor_id, :target_id diff --git a/features/members_block.feature b/features/members_block.feature index 26cf1a7..33ff390 100644 --- a/features/members_block.feature +++ b/features/members_block.feature @@ -29,7 +29,6 @@ Feature: And I follow "Manage my groups" Then I should see "Sample Community" - @selenium Scenario: a user can leave a community by members block's button Given "Maria Silva" is a member of "Sample Community" And I am logged in as "mariasilva" diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 213c8d5..ed31ba0 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -55,6 +55,10 @@ When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, end end +When /^(?:|I )move the cursor over "([^"]*)"/ do |selector| + find(selector).hover if Capybara.default_driver == :selenium +end + # Use this to fill in an entire form with data from a table. Example: # # When I fill in the following: diff --git a/features/support/selenium.rb b/features/support/selenium.rb index 5a7316d..0f4711c 100644 --- a/features/support/selenium.rb +++ b/features/support/selenium.rb @@ -1,7 +1,10 @@ +require 'selenium/webdriver' Capybara.default_driver = :selenium Capybara.register_driver :selenium do |app| - Capybara::Selenium::Driver.new(app, :browser => :firefox) + profile = Selenium::WebDriver::Firefox::Profile.new + profile.native_events = true + Capybara::Selenium::Driver.new app, browser: :firefox, profile: profile end Before('@ignore-hidden-elements') do -- libgit2 0.21.2