[Rails] Re: Testing if a controller renders a JS Template

2013-08-01 Thread João Pereira
nd http://jpereira.eu On Friday, July 26, 2013 1:10:30 AM UTC+2, João Pereira wrote: > > I have this controller: > > class UsersController < ApplicationController > def enable_password_change > respond_to do |format| > format.js { > render :layout => fals

[Rails] Testing if a controller renders a JS Template

2013-07-25 Thread João Pereira
I have this controller: class UsersController < ApplicationController def enable_password_change respond_to do |format| format.js { render :layout => false } end endend And the following test: test "should render js to show the change password form" do sign_i

[Rails] Re: My Weird error

2013-07-24 Thread João Pereira
Yes, I found my self installing all capistrano dependencies by hand on the remote machine, now it's ok. Strange I was able to make a deploy a some minutes before... Thnaks On Wednesday, July 24, 2013 5:03:13 PM UTC+2, mike wrote: > > > > On Tuesday, July 23, 2013 7:47:41 PM UT

[Rails] My Weird error

2013-07-23 Thread João Pereira
Hi, I'm getting this error while deploying to a dev machine with cap:deploy executing "cd -- /home/ubuntu/deployments/ appreleases/20130723233947 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile" servers: ["server

[Rails] My Weird error

2013-07-23 Thread João Pereira
Hi, I'm getting this error while deploying to a dev machine with cap:deploy executing "cd -- /home/ubuntu/deployments/appreleases/20130723233947 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile" servers: ["ec2-54-229-75-254.eu-west-1.compute.amazonaws.com"] [ec2-54-22

[Rails] Understating how assets in Rails 4 work in production

2013-07-20 Thread João Pereira
When I run rake assets:precompile The compiled assets are written to pubic/assets: I, [2013-07-21T02:16:00.987988 #13881] INFO -- : Writing /home/jpereira/dev/saleshub/public/assets/glyphicons-halflings-white-62b67d9edee3db90d18833087f848d6e.png I, [2013-07-21T02:16:01.037698 #13881] INFO

[Rails] Reusing functional tests with rails 4

2013-07-19 Thread João Pereira
With rails 4, I have this test for one controller: class Merchant::RegistrationsControllerTest < ActionController::TestCase test "should create new registration" do user = FactoryGirl.build(:merchant_user) #rest of the test using user as input for the controler end test "should n

[Rails] Re: How to assert the value of an input element with assert_select (Rails 4)

2013-07-19 Thread João Pereira
Will try that. Thanks On Friday, July 19, 2013 1:18:33 PM UTC+2, Frederick Cheung wrote: > > > > On Thursday, July 18, 2013 11:53:01 AM UTC+1, João Pereira wrote: >> >> Given this HTML in the view: >> >> How do I select the value of the button with assert_sel

[Rails] How to assert the value of an input element with assert_select (Rails 4)

2013-07-19 Thread João Pereira
Given this HTML in the view: Recover Pasword How do I select the value of the button with assert_select? I try assert_select 'form input[type=submit]', "Send Reset Instructions" but its failing with expected but was <>.. Expected 0 to be >= 1. Basical

Re: [Rails] Rails 3 route problem

2011-02-12 Thread João Pereira
Yeah, I was only allowing POST and GET on that route, Rails was looking for a PUT because the object user was not new. Thanks On Thu, Feb 10, 2011 at 12:28 AM, Jim Ruther Nill wrote: > since the routes match exactly, I think the problem is in the method.  I > haven't used simple_form yet so I do

[Rails] Re: Testing cookies.permanent.signed

2011-02-08 Thread João Pereira
Anyone knows how to test cookies.permanent? On Feb 8, 2011 5:36 PM, "João Pereira" wrote: Hi, When using: def some_action cookies.permanent.signed[:cookie_name] = "somevalue" end How do I test it in functional tests? I'm trying to user: assert_equal "someva

[Rails] Testing cookies.permanent.signed

2011-02-08 Thread João Pereira
Hi, When using: def some_action cookies.permanent.signed[:cookie_name] = "somevalue" end How do I test it in functional tests? I'm trying to user: assert_equal "somevalue", cookies.permanent.signed[:cookie_name] but I'm getting NoMethodError: undefined method `permanent' for # Thanks, --

Re: [Rails] Re: How to make PUT with html forms?

2009-12-13 Thread João Pereira
Ok, thank you. My form is not AJAXified. I managed to fix the problem. It probably has something to do with the rendering of the form using form_tag. If I have hardcoded the hidden field, everything is fine: <%=password_field_tag :password_confirmation, @password_confirmation %> This is a hack an

[Rails] WARNING: Can't mass-assign these protected attributes: name, password, email

2009-11-22 Thread João Pereira
Hi, I'm having the follwoing Warning preventing a model to be saved: WARNING: Can't mass-assign these protected attributes: name, password, email My Model is: class User < ActiveRecord::Base attr_accessible :password_confirmation validates_confirmation_of :password attr_accessible :email_

[Rails] WARNING: Can't mass-assign these protected attributes: active

2009-11-22 Thread João Pereira
Hi, I'm trying to understand this error: WARNING: Can't mass-assign these protected attributes: active I had this error before when creating a record.I did not mark the attibutes posted from the form as attr_accessible, so when the following line tries to execute it throwed an Warning in the log