Displaying 20 results from an estimated 10000 matches similar to: "Outside-In with RSpec on Rails"
2007 Apr 11
5
Default exclude pattern in 0.9.0
The "rspec" rake task collects all _spec files in the spec directory,
and excludes the "watir" directory.
Is this indicating a preference for using Watir over Selenium? I would
like it better to standardize on something more neutral, ''ui'' perhaps?
/Marcus
--
Marcus Ahnve
http://marcus.ahnve.net
2007 May 29
2
Selenium, Spec:Ui and ... forks?
I am using Spec:UI to run my Selenium tests, and I want to start
Selenium only once, for many descriptions.
I''ve come quite far solving it by declaring a main ui spec like the following:
require ''pathname''
require File.dirname(__FILE__) + ''/selenium''
$base_url="http://localhost:3000"
$browser =
2008 Jan 19
6
Quiet Backtrace in RSpec
I''m using RSpec on Rails and would like to clean up the backtraces, so I
went looking for an RSpec equivalent to ThoughtBot''s Quiet Backtrace
gem<http://thoughtbot.com/projects/quietbacktrace>.
I found Spec::Runner::QuietBacktraceTweaker in the RDOCS, but I can''t figure
out how to use it. Can I add something to spec_helper.rb that will
utilize
2007 Oct 17
9
plain text stories: motivation number 27
This is mostly theoretical, but ...
I''m starting to use lighthouse (http://llighthouseapp.com) for my
projects at work. I''m organizing iterations as milestones and stories
as tickets tagged to a milestone.
Lighthouse offers an API so that you can write access the data in your
account and write apps to process that data.
I think you see where this is going.
It seems to me that
2007 Apr 17
8
problem with rspec_on_rails and @controller.should_receive(:render) in trunk
Hey guys!
I am using rspec trunk, and I am having a little problem with the
latest version. (I am quite sure this worked with an older version
about a week ago)
heres the spec:
it "should render the new user form without layout for a xhr request" do
@controller.should_receive(:render).with(:layout=>false)
xhr :get,:new
end
and the controller:
def new
render
2007 Apr 13
21
ZenTest autotest now handles RSpec, yay!
Josh Knowles http://joshknowles.com/ just let me know that ZenTest Autotest
3.50 now handles your RSpec specs.
http://blog.zenspider.com/archives/2007/04/zentest_version_350_has_been_released.html
That''s a great news.
Josh also shared with me a quick hack to make autotest work with only the
RSpec plugin installed.
Add the following into your ~/.autotest file
2007 May 30
9
Specify attr_protected
This is kind of a two part question.
Question One: I want to be sure that an Order model is protecting
sensitive attributes from mass assignment.
The example looks like this:
describe Order do
it "should protect total attribute from mass assignment" do
@order = Order.new(:total => 0.05)
@order.total.should_not == 0.05
end
end
And the code to implement it:
class Order
2007 Jul 25
5
MockCov: Proof of concept
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''d like to demonstrate another perspective of coverage analysis I''ve hacked
up.
The perspective is that of what is mocked and
2007 Apr 07
5
Integration Specs On Rails
Now that RSpec is nearing 1 dot oh, are there any plans to implement
an integration testing equivalent in RSpec On Rails?
2007 Dec 07
4
TextMate Sidebar
Hey David,
I just watched the RubyConf recording of your RSpec session and noticed that
you''re using a modified version of TextMate that uses a sidebar instead of a
project drawer. Where did you find that mod?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071207/c900e1bc/attachment.html
2007 Jul 14
3
expect_render twice in views
I found this:
controller.expect_render(:partial => ''thing'', :collection => things).once
but I am trying to expect_render twice in my view spec:
template.expect_render(:partial => ''order_details'').twice
This doesn''t work as the template.expect_render call seems to be
returning an array. Is it possible to expect the rendering of a
partial
2007 Sep 20
4
alias :calling :lambda
Sprinkling my examples with ''lambda'' has always seemed like a bit of a
wart to me. I''ve gotten into the habit of adding ''alias :calling
:lambda'' to my spec suites. My examples then look like:
calling { Foo }.should raise_error
calling { Bar }.should_not raise_error
Is there a reason that RSpec core has chosen not to make exception
expectations more
2006 Nov 21
10
Rspec Brown Bag
Hello,
I''m scheduled to give a rspec brown bag this Wednesday (11/22) for my
company (Pivotal Computer Systems, http://www.pivotalsf.com). I did see Dave
Astel''s talk as well as several of my coworkers.
The developers at my workplace are experienced Agile developers.
What would be some good things to focus on for this brown bag?
Are there slides to presentations that would be
2007 May 30
4
Using mocks
I''ve just started doing TDD/BDD and like the idea of mocks. So I set
out to use them. The doc pages seem great, I setup the mock and then
it just works. Here is what I am trying to do:
Myuser is a non-rails model of user attributes. We are going to be
mocking the connection to the ldap server. The user class has a login
method that connects to the ldap server and if successful,
2007 Aug 24
26
testing behaviour or testing code?
hypothetical question for all you BDD experts:
I want to make sure that a :list action always returns widgets in
alphabetical order. There''s at least 2 ways of doing this:
it "should fetch items in alphabetical order" do
Widget.should_receive(:find).with(:order => "name ASC")
get :list
end
it "should fetch items in alphabetical order" do
[:red,
2008 Jun 04
6
any_instance
Hi folks.
I''m very interested in the status of a port of any_instance from Mocha to RSpec.
In particular I have a spec suite that I wrote using RSpec but with
Mocha that depends heavily on any_instance. This is because it stubs
out one or two methods from an underlying API. In attempting to
convert the suite to RSpec mocks (because that''s what we''re using for
the rest
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing
in model specs? I heard from agile on IRC that they save the database
testing for integration testing, but I also see that the caboose
sample applicaiton uses fixtures. I also noticed that on the rspec
site, it says "Ironically (for the traditional TDD''er) these are the
only specs that we feel should actually
2007 Jun 08
20
When to use BDD/TDD w/ external libraries
Test First Development is great...But should you use it when you are
adding classes/methods on to external library that doesn''t have an
extensive test suite? I noticed that the rspec plugin for autotest
has no specs.
David Chemlinsky said something to the list a while back that has
been stewing in my subconscious - that you develop software
differently using Test First
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance
of the controller call. But it makes it difficult to do something like:
context "The HarkController, given Louie the logged-in user" do
setup do
post :login, :username => ''louie'', :password => ''atest''
end
specify "should redirect Louie to the home
2007 Mar 24
15
State Based vs. Behaviour Based Spec/Testing
I''ve notice that a project like Rubinius has both a spec & a test
directory. Rspec has only a spec directory. Obviously I support
BDD, but isn''t there also a place for state based/verification
testing? I sometimes sense that I *do* want to practice Test Driven
Development. That is, I want some assurance that my production code
will run as intended. But I also