Commit 146786cb029924476bbff5cb30d62a72e02b86e3
1 parent
5034abbb
Exists in
master
and in
28 other branches
Fixing cucumber tests
Showing
5 changed files
with
20 additions
and
3 deletions
Show diff stats
app/views/catalog/index.rhtml
| ... | ... | @@ -7,13 +7,15 @@ |
| 7 | 7 | |
| 8 | 8 | <div class='l-sidebar-left-bar'> |
| 9 | 9 | <ul> |
| 10 | - <% if @categories.size > 0 %> | |
| 10 | + <% if @categories.present? %> | |
| 11 | 11 | <% @categories.each do |category| %> |
| 12 | 12 | <%= category_link(category) %> |
| 13 | 13 | <%= category_sub_links(category) %> |
| 14 | 14 | <% end %> |
| 15 | + <% elsif @category.present? %> | |
| 16 | + <%= content_tag('li', _('There are no sub-categories for %s') % @category.name, :id => 'catalog-categories-notice') %> | |
| 15 | 17 | <% else %> |
| 16 | - <%= content_tag('li', _('There are no sub-categories for %s') % @category.name, :style => 'color: #555753; padding-bottom: 0.5em;') %> | |
| 18 | + <%= content_tag('li', _('There are no categories available.'), :id => 'catalog-categories-notice') %> | |
| 17 | 19 | <% end %> |
| 18 | 20 | </ul> |
| 19 | 21 | </div> | ... | ... |
features/browse_catalogs.feature
| ... | ... | @@ -18,7 +18,7 @@ Feature: browse catalogs |
| 18 | 18 | |
| 19 | 19 | Scenario: display titles |
| 20 | 20 | Then I should see "Associação de Artesanato de Bonito" |
| 21 | - And I should see "Products/Services" within "#product-list" | |
| 21 | + And I should see "Products/Services" | |
| 22 | 22 | |
| 23 | 23 | Scenario: display the simplest possible product |
| 24 | 24 | Given the following products | ... | ... |
features/signup.feature
| ... | ... | @@ -3,6 +3,7 @@ Feature: signup |
| 3 | 3 | I want to sign up to the site |
| 4 | 4 | So I can have fun using its features |
| 5 | 5 | |
| 6 | +@selenium | |
| 6 | 7 | Scenario: successfull registration |
| 7 | 8 | Given I am on the homepage |
| 8 | 9 | When I follow "Login" |
| ... | ... | @@ -13,6 +14,7 @@ Feature: signup |
| 13 | 14 | | Password | secret | |
| 14 | 15 | | Password confirmation | secret | |
| 15 | 16 | | Full name | José da Silva | |
| 17 | + And wait for the captcha signup time | |
| 16 | 18 | And I press "Create my account" |
| 17 | 19 | Then I should not be logged in |
| 18 | 20 | And I should receive an e-mail on josesilva@example.com |
| ... | ... | @@ -36,6 +38,7 @@ Feature: signup |
| 36 | 38 | And I go to signup page |
| 37 | 39 | Then I should be on Joao Silva's control panel |
| 38 | 40 | |
| 41 | + @selenium | |
| 39 | 42 | Scenario: user cannot register without a name |
| 40 | 43 | Given I am on the homepage |
| 41 | 44 | And I follow "Login" |
| ... | ... | @@ -44,6 +47,7 @@ Feature: signup |
| 44 | 47 | And I fill in "Username" with "josesilva" |
| 45 | 48 | And I fill in "Password" with "secret" |
| 46 | 49 | And I fill in "Password confirmation" with "secret" |
| 50 | + And wait for the captcha signup time | |
| 47 | 51 | And I press "Create my account" |
| 48 | 52 | Then I should see "Name can't be blank" |
| 49 | 53 | ... | ... |
features/step_definitions/noosfero_steps.rb
| ... | ... | @@ -538,6 +538,7 @@ end |
| 538 | 538 | |
| 539 | 539 | Then /^I should receive an e-mail on (.*)$/ do |address| |
| 540 | 540 | last_mail = ActionMailer::Base.deliveries.last |
| 541 | + last_mail.nil?.should be_false | |
| 541 | 542 | last_mail['to'].to_s.should == address |
| 542 | 543 | end |
| 543 | 544 | |
| ... | ... | @@ -748,3 +749,8 @@ Given /^the profile (.*) is configured to (.*) after login$/ do |profile, option |
| 748 | 749 | profile.redirection_after_login = redirection |
| 749 | 750 | profile.save |
| 750 | 751 | end |
| 752 | + | |
| 753 | +When /^wait for the captcha signup time$/ do | |
| 754 | + environment = Environment.default | |
| 755 | + sleep environment.min_signup_delay + 1 | |
| 756 | +end | ... | ... |
public/stylesheets/application.css
| ... | ... | @@ -2715,6 +2715,11 @@ div#activation_enterprise label, div#activation_enterprise input, div#activation |
| 2715 | 2715 | padding: 0; |
| 2716 | 2716 | } |
| 2717 | 2717 | |
| 2718 | +#catalog-categories-notice { | |
| 2719 | + color: #555753; | |
| 2720 | + padding-bottom: 0.5em; | |
| 2721 | +} | |
| 2722 | + | |
| 2718 | 2723 | /* * * Show Product * * * * * * * * * * * * */ |
| 2719 | 2724 | |
| 2720 | 2725 | .controller-catalog #show_product .product-pic { | ... | ... |