Displaying 20 results from an estimated 900 matches similar to: "Cookies in RSpec"
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people!
Still rspec nuby: I must do something wrong obviously.
How can I spec about redirect_to at ApplicationController
describe ApplicationController do
it "method login_required should redirect to home path without login" do
pending "I tried to use controller.login_required.should be_redirected
and got NoMethodError with nil object
2007 May 26
11
RSpec
Hi RSpec Mailing list,
I''m new to RSpec and I am trying to get it running with the caboo.se sample
rails app.
I installed the current version of rspec with rspec_on_rails
I tried to run rake spec but received:
330-07:~/desktop/restful_auth_rspec/vendor multimedia$ rake spec
(in /Users/multimedia/Desktop/restful_auth_rspec)
2008 Jun 20
15
before_save model callback rspec testing
hi all,
i''m learning rspec and i can''t figure out how to test if a callback is
executed in a model.
my model code is:
class User < ActiveRecord::Base
before_save :encrypt_password
...
def encrypt(password)
self.class.encrypt(password, salt)
end
thanks a lot,
cs.
--
Posted via http://www.ruby-forum.com/.
2012 May 12
12
before_save messing up
#user.rb ------> Model
class User < ActiveRecord::Base
attr_accessible :email, :name, :password, :password_confirmation
has_secure_password
before_save :create_remember_token
.
.
.
.
.
.
.
private
def create_remember_token
self.remember_token = SecureRandom.urlsafe_base64
end
end
#sessions_controller.rb ------->
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here:
http://railstutorial.org/chapters/sign-in-sign-out#top
At the end of the tutorial, rails is erroring (see below). being new
to Rails and after having checked the tutorial... How do you resolve
this kind of error. It''s saying current_user is not defined, and it is
supposed to be defined with/Sites/sample_app/app/helpers/
2007 Sep 09
11
Going beyond the default html formatter/report?
Hi!
I wonder does anybody planning to go beyond the default html formatter/report?
The current html report is nice and green but what about to go a
little silly and enable also user input. For example to let customer
to add a new pending spec, comments etc. I feel it might be mentally
easier for some customers to jump into spec world when it is possible
to give input at "the same
2007 Jun 12
3
rspec 1.0.x and liquid?
Is anyone else using liquid with the > 1 rspec? This seems to fail:
it ''should render show'' do
response.should render_template(''buyers/show'')
get :show, :id => 1
end
with an error like
1)
NoMethodError in ''/buyer GET should render show''
You have a nil object when you didn''t expect it!
The error occurred
2011 May 21
5
simple home_url question
A silly as this sounds, I''m not sure how to set the route for the
home_path and home_url helpers. Google has nothing on this. Where do I
define what those paths should resolve to?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2007 Aug 26
2
ror app with advanced rspec?
Hi!
Can anybody link to some ror based project what is using rspec, so
nuby as me can learn from it. So it should have updated and practising
advanced rspec.
After reading last threat about "testing behaviour or testing code?",
I just realised that I would definitely learn something from app like
that. Some casual googling didn''t help me this time.
Thanks!
Priit at
2007 Jan 17
1
Machine account in Users home
Hello, Am i suppose to see win machine names in users home? they are created
when users login using their workstations
here is my home directory
[cat@itbox CAD]$ ls -l
total 20
drwx------ 3 ad01$ Domain Computers 4096 Jan 17 17:57 ad01_
drwx------ 3 administrator Domain Users 4096 Jan 17 17:59
administrator
drwx------ 3 cat Domain Users 4096 Jan 17
2008 Sep 29
3
rspec-ui overlap with cucumber?
Hi!
I''m using cucumber + selenium and I love it. However I''m looking to
add some methods (example: click_and_wait etc) to the lib. Therefore
looked around a bit and I got two questions:
Firstly about rspec-ui, I''m a little confused, does rspec-ui overlap
with its propose with webrat with cucumber or I''m missing a point?
Secondly, are there any plans to
2006 Aug 22
7
Cleanup at session expiration
I''m going to explicitly time out sessions if they''re idle more than X minutes. Like online banking sites do.
How do I set things up so that, when a session expires, a set of database records and a set of files that may have been created (which are identified via a seperate set of database records) are deleted just before the session data?
TIA,
Bill
2007 Aug 17
4
should_receive, used in the wrong place?
What do you guys think of this: if someone calls should_receive
outside of an "it" block, it warns you.
before(:each) do
@foo = Foo.new
@foo.should_receive(:monkeys)
end
would warn you that you''re setting an expectation in the wrong place,
and that "stub" is correct when setting up objects.
Opinions?
courtenay
2006 Jul 10
1
Redirects and keeping flash
My code that acts if a session has timed out looks like this:
reset_session
session[:expires_at] = nil
# TODO - This flash is never shown, because we redirect maybe?
flash[:error] = ''Your session has timed out, please login to
continue.''
# An attempt to make flash stick around, not working
flash.keep
redirect_to :controller => ''security'',
2007 Oct 13
1
specing system
Hi!
Having some wine on Saturday and just playing around writing some ruby script:
* have you spec any ''system'' method? As long I know it just returns
false or true and everything else is just out of reach; prove me I''m
wrong :-)
it ''should have response with 64.233.167.99''
system ''ping google.com''
Priit
2006 Dec 31
2
what''s with the response.should_be_xxxx stacktrace?
If I do
get :index
response.should_be_success
I get about 20k of marshalled dumpage that starts like
#<ActionController::TestResponse:0x390443c @body=\"<html><body>You
are being <a href=\"http://test.host/carts/1\">redirected</a>.</body></html>\",
@assigns=[], @redirected_to={:action=>\"show\", :id=>1},
2007 Aug 28
3
How do you keep mocks updated without pain?
Hi!
I know you must be answering a lot of basic questions, sorry about that :-)
However I have not get it, how do you keep mocks updated without pain?
I reached to the point where mocking things for view. I spec
model-controller-view using "correct doc" way mocking-stubbing (plus I
should run integration test to be sure that everything really works
together).
Now, when I want to
2006 May 02
2
flash not shown
I am using the following code (inspired by one of the books) to check if
the user''s session should have timed out.
# Check to see if the user has been inactive for longer than the
# expiry period. If they have, reset the session.
def check_timeout
if session[:expires_at] != nil
@time_left = (session[:expires_at] - Time.now).to_i
unless @time_left > 0
2005 May 11
7
1.0.8 Salted hash login generator available
All,
Version 1.0.8 of the salted hash login generator is available.
This contains a few minor bug fixes with the generator plus some
README clarifications. If you are successfully running with the code
already, you probably do not need this.
Joe
2007 Jun 18
7
Testing for cross site scripting, etc.
Being new to testing and ruby, are there "standard" tests that can be
done that test for things like cross site scripting and friends?
If not, anyone have ideas on what I might do about testing those sorts
of things?
I''ll be using rails, also.
Mike B.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging