Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
describe UsersController do
describe "confirm email" do
before(:each) do
@confirmed_user = Factory.create(:confirmed_user)
@confirmed_user.email = "new"+@confirmed_user.email
@confirmed_user.save
resources :users do
get :confirm_email
end
#####
user_confirm_email GET /users/:user_id/confirm_email(.:format) {:action=>"confirm_email", :controller=>"users"}
#####
def buy(buyer)
if self.user != buyer
self.date_sale = Time.now
self.buyer = buyer
else
# Invalid
end
end
class BuildingsController < ApplicationController
before_filter :authenticate_user!, :except => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_admin!
# GET /buildings
# GET /buildings.xml
def index
@buildings = Building.all
<div class="field">
<%= f.radio_button :number, "0" %>
<%= f.label :number, "Call Back" %><br />
<%= f.radio_button :number, "1" %>
<%= f.label :number, "Send E-Mail" %>
</div>
def building_update(building)
BuildingNotification.where(:building_id => building.id).each do |bn|
mail :to => bn.user.email,:subject => "Update for #{building.project_title}"
end
end
Scenario: Edit Company Name # features/user_edit.feature:6
Given I am signed up and signed in with "test@example.com" # features/step_definitions/session_steps.rb:12
And I am on the home page # features/step_definitions/web_steps.rb:44
When I follow "My Info" # features/step_definitions/web_steps.rb:56
And I fill in "user[company_name]" with "Royal Snoker Casino" # features/step_definitions/web_steps.rb:60
And I fill in "user[current_password]" with "secret" # features/step_definitions/web_steps.rb:60
And I press "Update" # features/step_definitions/web_steps.rb:52
undefined method `node_name' for nil:NilClass (NoMethodError)
./features/step_definitions/web_steps.rb:53:in `/^(?:|I )press "([^"]*)"$/'
features/user_edit.feature:12:in `And I press "Update"'
!!!
%html
%head
%title Royal7
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag
%body
= if user_signed_in?
.head
- for asset in @building.assets
.widget
.file_icon
%img{:src => "/images/pdf_logo.png", :width => "45", :height => "45"}
.file_info
%h5 Bauplan.pdf
$('.submittable').live('change', function() {
$(this).parents('form:first').submit();
return false;
});