Hi,
I'm writing a specification for a model called Location which has a
post_code attribute which should be a valid UK postcode. I'm using the
http://svn.designbyfront.com/rails/plugins/validates_as_uk_postcode/
validates_as_uk_postcode plugin to handle the validation but I'm not sure
how I sho
Yeah - I think that's a neat idea too.
Does the code only work with RSpec's mocking framework? Maybe it
could be integrated into Rcov somehow.
Scott
On Jul 25, 2007, at 12:27 PM, Marcus Ahnve wrote:
> Really cool - I have asked myself that question several times.
>
> /Marcus
>
> On 7/25/07,
I've done some more work on the specs, and it seems that my mocks
aren't pushing in the roles array associated with current_user.
describe UsersController do
before(:each) do
@user = mock_model(User,
:id => 1,
:email => '[EMAIL PROTECTED]',
:password => 'teamup'
)
For starters, refactor your user<-->roles interaction.
class User
def has_role?(name)
role = Role.find_by_name(name)
roles.include?(role)
end
end
Trust me, this will make things much easier to spec, and later, to
scale. Also, it keeps the DB-specific stuff ("find") in the model,
wh
On 7/25/07, Ian Leitch <[EMAIL PROTECTED]> wrote:
> Hey list,
>
> RSpec is great, I've been using it at work for a couple of months now. One
> gripe I have is that I find it hard to know exactly to what extent my code
> is covered by the specs. I am aware of RCov and Heckle; they're great, but
> I'
On 7/26/07, Yurii Rashkovskii <[EMAIL PROTECTED]> wrote:
> David,
>
> >>
> >> Here is an extract from my source code
> >>
> >> it "should allow authenticated user to access '#{action}'" do
> >>@user = mock_user_authentication(:id => 1, :identity_url =>
> >> "http://openid.server/yrashk
David,
>>
>> Here is an extract from my source code
>>
>> it "should allow authenticated user to access '#{action}'" do
>>@user = mock_user_authentication(:id => 1, :identity_url =>
>> "http://openid.server/yrashk";, :queues => [])
>>get action, params
>>assigns[:curre
David,
Depending on action, it is either successful response or response
that redirects somewhere (but not to login, since user is
"proven" to
be authenticated). In this example, I really don't want to care,
whether it was successful response or redirection to somewhere,
On 7/26/07, Yurii Rashkovskii <[EMAIL PROTECTED]> wrote:
>
> On Jul 27, 2007, at 3:26 AM, David Chelimsky wrote:
>
> > On 7/26/07, Yurii Rashkovskii <[EMAIL PROTECTED]> wrote:
> >> Hey,
> >>
> >> May be it is just too deep night over here and I'm missing something
> >> though I got this failure on
On 26/07/07, Marcus Crafter <[EMAIL PROTECTED]> wrote:
It's been renamed from rspec_resource to rspec_scaffold in a more
recent release, looks like you're installation is good to go. We
should look at updating the web site to reflect the name change.
Hope this helps mate.
Cheers,
Marcus
Hi Paul,
On 27/07/2007, at 1:13 AM, Paul Brackenridge wrote:
> When I run script/generate I get the following:
>
> Installed Generators
> Plugins: authenticated, rspec, rspec_controller, rspec_model,
> rspec_scaffold
> Builtin: controller, integration_test, mailer, migration, model,
> obs
On 7/26/07, rob_twf <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm writing a specification for a model called Location which has a
> post_code attribute which should be a valid UK postcode. I'm using the
> http://svn.designbyfront.com/rails/plugins/validates_as_uk_postcode/
> validates_as_uk_postcode
On Jul 26, 2007, at 6:54 PM, Peter Marklund wrote:
> Hi Don!
> Thanks, that looks nice. For now I'm just using this bash alias:
>
> alias specdoc='spec spec -f h:spec/spec_report.html; open spec/
> spec_report.html'
>
> However, I guess it's nicer to have this be a Rake task so that it
> can be u
Hi!
I was just wondering how you typically generate a spec HTML report in
a Rails app. Currently I'm doing something like this:
spec spec -f h:spec/spec_report.html
But that seems sort of clumsy and I would have thought that there was
a rake task for it. Have I overlooked something?
Thanks!
On Jul 27, 2007, at 3:26 AM, David Chelimsky wrote:
> On 7/26/07, Yurii Rashkovskii <[EMAIL PROTECTED]> wrote:
>> Hey,
>>
>> May be it is just too deep night over here and I'm missing something
>> though I got this failure on {{{response.should_not redirect_to}}}:
>>
>> 'QueuesController should a
On 7/26/07, Yurii Rashkovskii <[EMAIL PROTECTED]> wrote:
> Hey,
>
> May be it is just too deep night over here and I'm missing something
> though I got this failure on {{{response.should_not redirect_to}}}:
>
> 'QueuesController should allow authenticated user to access 'show''
> FAILED
> Matcher d
Hey,
May be it is just too deep night over here and I'm missing something
though I got this failure on {{{response.should_not redirect_to}}}:
'QueuesController should allow authenticated user to access 'show''
FAILED
Matcher does not support should_not.
See Spec::Matchers for more information
There might be a "better" way to do it, but I basically ripped off
the builtin spec:doc Rake task almost verbatim and made a custom task
in my Rails app for generating the HTML report. This isn't anything
magical, but you should be able to drop a file called
"whatever_you_want.rake" in you
First of all hi, I'm new to the list, and rather new to rspec as will
probably show in myquestion.
I have tried installing rspec and rspec_on_rails as plugs both using
"script/install" and
"piston import" commands using the "current release install instructions"
here [1]. However,
there doesn't s
Recently as a result of using Git I've noticed a number of
inconsistencies in the RSpec codebase with respect to whitespace
(mixed line endings, mixed use of spaces and tabs for indentation,
and trailing whitespace at the end of lines). I never would have
noticed, but Git produces nice colo
I ran into something really puzzling today. I don't know exactly why
it's happening, but I thought I'd share my experiences.
I started a dummy app just to test an idea outside of the context of
my real work today. So, I quickly get things started:
* rails junk
* cd junk
* ruby script/plugin
Hi Don!
Thanks, that looks nice. For now I'm just using this bash alias:
alias specdoc='spec spec -f h:spec/spec_report.html; open spec/
spec_report.html'
However, I guess it's nicer to have this be a Rake task so that it
can be used by the whole development team. I was looking for an easy
w
22 matches
Mail list logo