Displaying 20 results from an estimated 24 matches for "relishapp".
2011 Aug 05
5
named context or calling include_context with block?
Hello,
I''m playing around with Rspec again after going from test/unit to
rspec then back to test/unit... :) Right off the bat, I find myself
wanting to do something like this: https://gist.github.com/1128091
Basically, I want to name a context, then call it later by name,
passing a block to it.
Or in other words... what is the best way to DRY this code?
2011 Sep 13
12
Assertions for asynchronous behaviour
...entary - the failure message isn''t very helpful. Is there anything else already out there?
[1] http://www.growing-object-oriented-software.com/
cheers,
Matt
--
Freelance programmer & coach
Author, http://pragprog.com/book/hwcuc/the-cucumber-book (with Aslak Helles?y)
Founder, http://relishapp.com
+44(0)7974430184 | http://twitter.com/mattwynne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110913/cd84b813/attachment.html>
2011 Feb 11
2
Pull requests via Github - To Fork or Not? That is the Question.
Hi,
I''ve been coming up with some documentation examples, which I''d like
to contribute as Cucumber features to go into the relishapp.
I started following the contribute instructions on the rspec-dev
README[1] but have a question about pull requests.
Should I clone from the rspec/* projects on github, or fork them all
and then setup my local development environment from my own forks?
If the preferred method is to clone from th...
2010 Nov 03
3
Rake task for focused examples
Hi,
Is it possible to make a rake task to run examples with a certain
filter on? In this case I want to run rake spec:focused and run only
the examples with :focus => true.
- Toni
2011 Dec 05
5
Spec'ing a block
Hi folks
How would you spec something like this:
as_user username do
FileUtils.chmod_R 0755, "#{directory}/*"
end
Where as_user fires off a new process (and set uid to username).
It seems that this won''t catch FileUtils.chmod_R:
FileUtils.should_receive(:chmod_R).with(0755, "#{@domain.directory}/*")
I guess that is because it is passed in the block
2012 Aug 03
1
Mock_model not recognizing act_as_mappable
I am using mock_model in my tests, and I encountered a situation where my
stub is failing. Here''s the scenario:
Controller:
@locations = Location.al(:bounds=>bounds)l
@locations.sort_by_distance_from([bounds.center.lat,bounds.center.lng])
Rspec:
@location = mock_model(Location)
Location.stub(:all).and_return([@location])
2012 Feb 21
8
should_receive_chain
Do you often find yourself doing this:
active = double(''active'')
active.should_receive(:first)
users = double(''users'', active: active)
account.should_receive(:users).and_return(users)
for this:
account.users.active.first
?
Of course, we could use stub_chain, but that doesn''t let us know
*where* the chain broke.
Would you like to do this?
2011 Oct 18
8
rspec 1.3.2, Rails 2.3.14 - plugins not loading
Hi there
I have a weird situation. I have inherited a project in Rails 1.2.3
that has been upgraded to Rails 2.3.14 (and is running). I have
installed Cucumber and Rspec to start to write features/tests for the
new code that needs to be written. In my Gemfile, these Gems are
loaded:
group :test do
gem ''rspec-rails'', ''~> 1.3.4'', :require =>
2011 Oct 08
1
Rails view spec expectations/matchers
>From looking at the RSpec Rails documentation
(https://www.relishapp.com/rspec/rspec-rails/docs/view-specs/view-spec) it
seems like rendered is just a string and you can''t really do any
assert_select type stuff out of the box.
After Googling around, it seems that the RSpec authors decided that if you
want that functionality, you should just use Capybara...
2011 Jan 07
1
no such file to load -- spec/rake/spectask
I am sorry but it seems like this should be a simple answer.
when i run a any rake command i get the following error:
no such file to load -- spec/rake/spectask
i amusing bundler and have the latest rspec installed.
any idea? make dev tough when you can not do any rake tasks...
2011 Jan 17
1
Using integrate_views for all controller specs
Is there a way to always use integrate_views for all controller specs?
I hate having to remember to insert that line into each one.
Thanks,
Joe
2011 May 14
1
RSpec stub question
Hi
I am using Mongoid. In Mongoid while saving a record we typically give
like in the controller
@post.safely.save
For a model class Post
I am writing rspecs for my controller and want to mock the model. So
what I am doing is
let(:post) { mock_model(Post).as_null_object }
before(:each) do
Post.stub(:new).and_return(post)
end
it "creates new post"
2011 Jul 29
2
How can I make before/after all a method?
I would like to turn this:
describe TestClass do
before :all do
# set some config
end
after :all do
# restore some config
end
# do a bunch of tests to this
end
into
describe TestClass do
with_config_value(X)
# do a bunch of tests to this
end
Basically, I want to include before :all and after :all clauses into a test.
However, I do not want this to apply toa ll tests.
Thanks in advance.
2011 Aug 10
1
How to detect test fail on after(:each) method?
Hi All:
I am working on a test, and I need to detect if the test failed on the
after(:each) method, just to call a WebService.
Thanks!
2012 Jun 14
3
Selenium+Autotest: how to run browser in background?
Hey guys
After hours of hard work I finally managed to set up my development
environment to run cucumber scenarios using autotest and selenium.
What''s a bit bugging is the fact that Firefox always jumps to the
foreground when Autotest does its job. How can I keep Firefox in the
background so that I can continue with my work without being
interrupted?
Thanks!
--
Posted via
2011 Dec 05
1
How to extend common helper methods to view specs?
Hi, there,
I have some methods which I have written as helpers.
They are in spec/support/controller_macros.rb (yes, I will change the
name soon).
The 2 methods, login_user and login_admin_user works in the
controller specs BUT fail to work in the view specs when I call them
in the view specs.
---------- spec/spec_helper.rb start --------------------------
# This file is copied to spec/
2012 Oct 09
8
unexpected should_receive behaviour
Hi,
surely I''m missing something... but what!?
in my spec I''ve
User.should_receive(:find).with("1").and_return(@user)
and in my controller
User.find(params[:id])
green light... correct...
but if I change my controller using another method, for example first:
User.first
or even
User.all
I get green light too... I was expecting an error like
expected: 1 time
2011 Sep 07
4
rspec testing inheritance
Hello,
Is there any way to test model inheritance in spec?
something like..
it { ChildModel.should < ParentModel }
thanks.
2012 Nov 26
8
why functional test does not get failure?
The test:
test "should get new" do
get :new, :room_id => @room.name
assert_template(:ne)
end
the template new does not exists but the test does not get failure.
Why?
--
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
2012 Feb 05
4
testing framework for test automation
Hello,
Anyone working in QA Test Automation with RSpec wouldn?t mind posting
their testing framework or know where I can go to get more info on
testing frameworks either with RSpec or Cucumber? I greatly
appreciate. Thank you.