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
| 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
| 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
| 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
| 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
| 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
| # encoding: utf-8 | |
| # http://wiki.github.com/botanicus/rango/controllers | |
| require "rango/helpers" | |
| require "rango/controller" | |
| require "rango/mixins/rendering" | |
| module Ark | |
| class Application < Rango::Controller |
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
| Merb::Router::Behavior.class_eval do | |
| def add_resource(*key) | |
| register_resource(*key) | |
| end | |
| end | |
| Merb.logger.info("Compiling routes...") | |
| Merb::Router.prepare do | |
| identify(User => :id) 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
| - extends "base.html" | |
| - block(:nav) do | |
| %ul | |
| %li= link_to "Dashboard", resource(:guns) | |
| %li= link_to "Settings", resource(:user, :edit) | |
| %li= link_to "Sign Out", url(:logout) | |
| - extend_block(:content) do | |
| %section#userbar |
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
| require 'bcrypt' | |
| module Ark | |
| module Mixins | |
| module BCryptUser | |
| def self.included(base) | |
| base.class_eval do | |
| attr_accessor :password, :password_confirmation | |
| before_save :encrypt_password |