From 2a6672812fc90af95c407b17a12ba18d6767f69b Mon Sep 17 00:00:00 2001 From: Daniel Cunha Date: Thu, 29 Nov 2012 01:34:19 -0300 Subject: [PATCH] accept_member.feature --- features/accept_member.feature | 6 +++--- features/step_definitions/noosfero_steps.rb | 23 ++++++++++++----------- features/support/paths.rb | 5 ++++- lib/noosfero.rb | 5 +++-- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/features/accept_member.feature b/features/accept_member.feature index 155145f..7037924 100644 --- a/features/accept_member.feature +++ b/features/accept_member.feature @@ -17,7 +17,7 @@ Feature: accept member Scenario: approve a task to accept a member as admin in a closed community Given "Marie Curie" asked to join "My Community" And I am logged in as "mario" - And I go to My Community's control panel + And I go to mycommunity's control panel And I follow "Process requests" And I should see "Marie Curie wants to be a member" When I choose "Accept" @@ -28,7 +28,7 @@ Feature: accept member Scenario: approve a task to accept a member as member in a closed community Given "Marie Curie" asked to join "My Community" And I am logged in as "mario" - And I go to My Community's control panel + And I go to mycommunity's control panel And I follow "Process requests" And I should see "Marie Curie wants to be a member" When I choose "Accept" @@ -39,7 +39,7 @@ Feature: accept member Scenario: approve a task to accept a member as moderator in a closed community Given "Marie Curie" asked to join "My Community" And I am logged in as "mario" - And I go to My Community's control panel + And I go to mycommunity's control panel And I follow "Process requests" And I should see "Marie Curie wants to be a member" When I choose "Accept" diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index ef647a7..5d73fab 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -289,17 +289,18 @@ Given /^the following price details?$/ do |table| end Given /^I am logged in as "(.+)"$/ do |username| - visit('/account/logout') - visit('/account/login') - fill_in("Username", :with => username) - fill_in("Password", :with => '123456') - click_button("Log in") - # FIXME selenium do not wait page load sometimes - if selenium_driver? - selenium.wait_for_page - end - Then "I should be logged in as \"#{username}\"" - @current_user = username + Given %{I go to logout page} + And %{I go to login page} + And %{I fill in "Username" with "#{username}"} + And %{I fill in "Password" with "123456"} + When %{I press "Log in"} + # FIXME: + # deveria apenas verificar que esta no myprofile do usuario + # nao conseguir fazer funcionar sem essa reduntancia no capybara + # acho que e algum problema com o http_referer + # olhar account_controller#store_location + And %{I go to #{username}'s control panel} + Then %{I should be on #{username}'s control panel} end Given /^I am logged in as admin$/ do diff --git a/features/support/paths.rb b/features/support/paths.rb index 6c4d1e5..a534e46 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -66,11 +66,14 @@ module NavigationHelpers when /^login page$/ '/account/login' + when /^logout page$/ + '/account/logout' + when /^signup page$/ '/account/signup' when /^(.*)'s control panel$/ - '/myprofile/%s' % Profile.find_by_name($1).identifier + '/myprofile/' + $1 when /^the Control panel$/ '/myprofile/%s' % User.find_by_id(session[:user]).login diff --git a/lib/noosfero.rb b/lib/noosfero.rb index 3e23665..3c0e750 100644 --- a/lib/noosfero.rb +++ b/lib/noosfero.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- require 'fast_gettext' module Noosfero @@ -80,8 +81,8 @@ module Noosfero def self.url_options if ENV['RAILS_ENV'] == 'development' development_url_options - elsif ENV['RAILS_ENV'] == 'cucumber' - Webrat.configuration.mode == :rails ? { :host => '' } : { :port => Webrat.configuration.application_port } + # elsif ENV['RAILS_ENV'] == 'cucumber' + # Webrat.configuration.mode == :rails ? { :host => '' } : { :port => Webrat.configuration.application_port } else {} end -- libgit2 0.21.2