This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected | |
| def render_optional_error_file(status_code) | |
| status = interpret_status(status_code) | |
| render :template => "/errors/#{status[0,3]}.html.erb", :status => status, :layout => 'application.html.erb' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| before :update do | |
| self.status_changed = true if attribute_dirty?(:status) | |
| end | |
| after :update do | |
| if status_changed | |
| monster_type.update_time_average | |
| self.status_changed = false | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: Creating client account | |
| As team member | |
| I want to create client account | |
| So additional account information can be provided after visiting specified link | |
| Scenario: Invalid email address provided | |
| Given I am logged in as team member | |
| When I go to clients index page | |
| And I fill in "Email" field with "invalid_email" in "New client" form | |
| And I click "Create" button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Given 'account with "$email" email does not exist' do |email| | |
| account = Account.where(:email => email).first | |
| account.delete unless account.nil? | |
| end | |
| Given 'I am not logged in' do | |
| visit "/logout" | |
| end | |
| When 'I go to registration form' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Padrino | |
| module Admin | |
| module Helpers | |
| module AuthenticationHelpers | |
| private | |
| def login_from_session | |
| Account.find(session[options.session_id]) if session[options.session_id] | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: Creating client account | |
| As team member | |
| I want to create client account | |
| So additional account information can be provided after visiting specified link | |
| Scenario: Invalid email address provided | |
| Given I am logged in as team member | |
| When I go to clients index page | |
| And I fill in "Email" field with "invalid_email" in "Invite client" fieldset | |
| And I click "Invite" button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Given 'account with "$email" email and password of "$password" exist' do |email, password| | |
| Given "account with \"#{ email }\" email does not exist" | |
| Account.create(:email => email, :password => password, :password_confirmation => password) | |
| end | |
| Given 'inactive account with "$email" email exist' do |email| | |
| Given "account with \"#{ email }\" email and password of \"secret\" exist" | |
| account = Account.where(:email => email).first | |
| account.is_active = false | |
| account.save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Compito.helpers do | |
| def absolute_url_for(*names) | |
| path = url_for(*names) | |
| scheme = request.scheme | |
| if (scheme == 'http' && request.port == 80 || | |
| scheme == 'https' && request.port == 443) | |
| port = "" | |
| else | |
| port = ":#{request.port}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Cucumber | |
| module Web | |
| module URLs | |
| def url_for(*names) | |
| Capybara.app.url_for(*names) | |
| end | |
| alias_method :url, :url_for | |
| def absolute_url_for(*names) | |
| "http://www.example.com" + Capybara.app.url_for(*names) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: Viewing client index | |
| As a team member | |
| I want to see client index | |
| Scenario: No client accounts exist | |
| Given I am logged in as team member | |
| And no active client accounts exist | |
| When I go to clients index page | |
| Then I should see "No active client accounts exist right now." message |