Hello There,
Can i spec session variable in my controller spec?
Is so, then how i can do it?
Following is my sessions_controller.rb file code:
-
def create
user = User.authenticate(params[:username], params[:password])
if user
2009/7/22 internetchris :
>
> So if that's the case is the main use of rspec within a rails app for
> the model and validation testing?
For a lot of people, yes. It's certainly a fair generalization that
model specs are the easiest and most straightforward specs in Rails.
If you're applying MVC w
How do I spec this following example from the Agile Rails Book listed
below. I am doing a similar thing in my controller and when I
attempted to change it to the collection way of doing the find I am
unable to get my spec to pass though I know it is working fine as my
cucumber features are passing
Hey guys,
I appreciate the insight, and this brings me to my next question, and
actually the next chapter in the book (specing models). I read that
"most" developers shy away from view specs (for the most part - not
always), and then if I understand both of you correctlyeach of you
tend to "do
2009/7/21 mpd :
>
> I'm sure this is due to some Rails change, but I can't find any info
> about it. Only running my specs is broken, both via rake and the spec
> command. I can use script/console with both test and development
> environments with no problems, and the app looks to be running fine.
2009/7/21 internetchris :
> When writing specs for controllers am I always
> going to mock the model? Are controllers always isolated from the
> actual model?
Hi Chris,
Pretty insightful of you. This is one of those philosophical
questions that tends to keep coming up. The only valid answer to
internetchris wrote:
I have one additional question after thinking about this for a while.
Forgive me if I'm about to read this in the book, It came to mind so I
thought I would ask. When writing specs for controllers am I always
going to mock the model? Are controllers always isolated from the
a
I have one additional question after thinking about this for a while.
Forgive me if I'm about to read this in the book, It came to mind so I
thought I would ask. When writing specs for controllers am I always
going to mock the model? Are controllers always isolated from the
actual model? If that's
> Hi,
>
> Hoping someone can help me out here. Whenever I try to run cucumber
> features I keep getting an error that "cucumber database is not
> configured". Stack trace is below.
>
Please use the Cucumber list (
http://wiki.github.com/aslakhellesoy/cucumber/get-in-touch), not this one.
When y
Hi,
A Rails project I'm working on has, for better or worse, some data-
driven structure in its models: a few model classes need certain
values (e.g. some enumerations) to be available in the database at
load time in order for certain bits of metaprogramming to kick off
correctly. It would
Hi,
Hoping someone can help me out here. Whenever I try to run cucumber
features I keep getting an error that "cucumber database is not
configured". Stack trace is below.
Here's some background info:
* I can successfully run all features on a different computer. This
error is being generated o
hello,
I've already asked via Rails channels on this and have received no
response, so I'm asking here in hopes someone has run into something
similar.
I updated to rails 2.3.3 yesterday, and now all of my specs are
failing with the following error:
Fixture::FormatError in 'PublishedGallery Meth
On Tue, Jul 21, 2009 at 1:51 PM, Peer Allan wrote:
> Hello all,
> Trying to update to rspec 1.2.8, but I keep getting rspec-rails 1.2.7.1, is
> that what I should be expecting?
There were no updates to rspec-rails, so the current releases are
rspec-rails-1.2.7.1 and rspec-1.2.8.
Cheers,
David
>
Hello all,
Trying to update to rspec 1.2.8, but I keep getting rspec-rails 1.2.7.1, is
that what I should be expecting?
Peer
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Thank you all for the replies!
>I use Cucumber for specifying application behaviour and RSpec for
>specifying lower level component behaviour. In the scenario you
>describe:
>* the application's job is to show only the active products
>* the view's job is to display any products it is given by the
Ben that worked perfectly I appreciate the help.
Stephen, I appreciate the encouragement, it feels daunting to be
learning all of this at once, but each day I bite off a little more
understanding. It's funny you mention scuba diving - "way back when"
right out of high school I thought it would be
Thanks for the thoughtful reply, Stephen -- perhaps I owe a bit of an
apology if my last response to you came off as a bit harsh; your
suggestions/ input is certainly appreciated. I always find posing these
types of questions over email to be a bit difficult. From the questioners
perspective, it'
On Tue, Jul 21, 2009 at 3:18 AM, Barun Singh wrote:
> I get your point, and I already understood it well before my original
> email. We all know that generic advice isn't always applicable in every
> instance, however, and this is a case where the number of distinct specs
> required to test all in
This is exactly what I was looking for -- I had no idea this was possible in
rSpec:
.and_return(item1, item2)
Somehow my eyes totally glossed over the "Consecutive return values" portion
of the docs despite having looked through that page many times trying to
find exactly that.
Thanks!
On Tue
On Tue, Jul 21, 2009 at 8:15 AM, Barun Singh wrote:
> I completely agree that testability is a huge benefit, and if changing code
> structure makes that easier then I'm all for it. My statement was only
> meant to imply that I didn't find testability to become any easier by
> refactoring this part
I completely agree that testability is a huge benefit, and if changing code
structure makes that easier then I'm all for it. My statement was only
meant to imply that I didn't find testability to become any easier by
refactoring this particular method, and absent that I didn't see any reason
to sp
Hi Barun,
On Tue, Jul 21, 2009 at 1:05 AM, Barun Singh wrote:
> I certainly appreciate the thoughtful and lengthy reply, but I think it
> misses the main part of my problem -- perhaps my original explanation of my
> issue was lacking in clarity. This isn't a question of refactoring; I can
> easil
I get your point, and I already understood it well before my original
email. We all know that generic advice isn't always applicable in every
instance, however, and this is a case where the number of distinct specs
required to test all input combinations that are of interest is simply too
large to
23 matches
Mail list logo