Displaying 20 results from an estimated 300 matches similar to: "Why use DatabaseCleaner with rSpec?"
2010 Dec 02
1
Global before blocks - filtering by multiple types
Hi
in the config block of rspec I have a before block to reset my
database before each spec:
config.before(:each) {DatabaseCleaner.clean}
I know I can apply this before to a specific type, e.g.
config.before(:each, :type => :model) {DatabaseCleaner.clean}
but what I want to achieve is that the database is cleaned for all
specs except acceptance specs. Is there a way to define this, e.g.
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/
2017 Nov 01
1
Creating Tag
i want to tag categories to its menuname.
i have a csv containing menu item name and in other csv i have a column
containing some strings,
i want to pick that strings from categories and look into menu items if
any menu item containing that string i want to create a new column next to
menu item name flagged as 1 otherwise 0
and the only condition is once a menu item flagged as 1 i don't need
2012 Feb 13
11
stale records with integration testing?
Hi,
I was writing an integration test for my user signup form (with
capybara), and found that my test was failing due to a validation error:
"email is already taken". I''m a bit confused because I thought when I
run "rspec spec/some_spec.rb", the test database would be wiped clear?
Is that not the case?
Patrick J. Collins
http://collinatorstudios.com
2004 Feb 24
2
Samba Slow, and I have high Quality NICS
I have SLOW file transfers across samba to my Windows Server 2000 domain.
I am using a built in 100bT Intel Pro NIC, I have tried the built in gigabit
NIC and a PCI 3com, all with the same results.
Using iperf, I get about 45-90Mb of bandwidth from my PC's to my samba
server.
I can pull it up by \\servername <file:///\\servername> or \\ipaddress
<file:///\\ipaddress> with out
2007 Aug 26
5
Issues with mod_proxy/mod_proxy_balancer and my ded. server host
Hello list,
I wonder if someone could help me understand the following:
I''ve got a managed dedicated server with GoDaddy. Until now, I''ve only
hosted PHP applications there. I now need to set it up to host my new
beloved Rails application. I asked them to set up apache with
mod_proxy_balancer for the mongrel cluster, however, here''s what they told
me:
*Unfortunately,
2010 Nov 17
3
How to use request helpers outside of controller specs?
I asked this questions on some other places before, but have found no
solution yet. I''d like to include the request helper (from
ActionDispatch::Integration::RequestHelpers, like post and xhr
methods) also in some specs outside of my controller specs. The
problem is that these request helpers are only included in spec/
controller and when a controller is described.
What do I have to
2005 May 21
2
Possible (ab)use of lexical scoping in R ?
Dear list,
I wish to define a set of functions *auxilliary* to another set of
"main" ones, and I wonder if there is some "clever" way do do this using
lexical scoping. Looking for that in the list's archives did not get me
easily understood answers. Perusing MASS (1st, 2nd, 3rd and 4th
editions!) and "Programming S" wasn't of much help either...
R easily
2006 Apr 16
7
Problem running unit tests
I am running Rails 1.1.2 with Ruby 1.82-15. My database is Postgresql. I
haven''t had any problems generating models, migrations, using scaffolds, and
generally building and using my application, but I haven''t been able to get
testing to work. I initially just ignored the problem and kept developing,
but would like to add proper testing from here on out.
Currently when I type
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would
like to test with RSpec. For that I use ''response.should
have_text("foobar")'' in my spec file, but that leads to a
Failure/Error: response.should have_text("enim")
undefined method `has_text?'' for #<ActionController::TestResponse:
0xb6736944>
I read here somewhere that webrat
2007 Jun 19
5
TentSteak 0.2.0
The second release of TentSteak is out and available as a gem on
rubyforge ("gem install tent_steak"). This version introduces a
handful of new form helpers, a couple method renames, editable HTML
tables, and some application bootstrappers for kickstarting Camping
and initializing ActiveRecord.
It''s still in active development, and I''d very much appreciate
2018 Feb 16
0
PhD Student / Postdoc job position at TU Berlin
Hi,
we are looking for either one post-doctoral researcher or PhD student to
work with us on the CELERITY project.
The main goal is the design of a programming environment to develop
energy- and performance- efficient, predictably scalable, and
easy-to-program parallel applications targeting large-scale
heterogeneous HPC clusters. The CELERITY environment will integrate a
compilation part
2008 Sep 01
4
Generating Images/PDF Server-Side
Hi,
I am working on a project where I need to generate a chart (a bit like a
pie chart, but very customised) and insert this into a PDF document.
Does anybody have any advice on ruby libraries (or other techniques) for
doing this? Open to suggestions?
The resulting PDF will be designed for printing and so ideally should be
vector throughout (or any raster images 300dpi). I was thinking of some
2006 Sep 11
4
Using rspec and mocha
I prefer to use rspec than test::unit for developing my apps. However
I''ve found its mocking library to be pretty inflexible compared to
Mocha. This isn''t really a surprise since rspec isn''t intended as a
mocking framework, whereas Mocha is. So I''d like to play to both of
their strengths and use rspec as my testing/specification framework
and Mocha do to
2006 Sep 11
4
Using rspec and mocha
I prefer to use rspec than test::unit for developing my apps. However
I''ve found its mocking library to be pretty inflexible compared to
Mocha. This isn''t really a surprise since rspec isn''t intended as a
mocking framework, whereas Mocha is. So I''d like to play to both of
their strengths and use rspec as my testing/specification framework
and Mocha do to
2020 Jul 28
2
Phabricator down for maintenance tonight
Could we ever consider adding
https://github.com/r4nt/phabricator/tree/llvm-production as a new read/only
observe Diffusion repository in reviews.llvm.org? I'd be happy to do code
reviews?
MyDeveloperDay
On Tue, Jul 28, 2020 at 8:46 PM MyDeveloper Day <mydeveloperday at gmail.com>
wrote:
> Awesome, thanks for sharing
>
> Here is a patch (based off yours) but this adds the
2007 May 18
2
TentSteak First Release
Hey all,
I just pushed out the inaugural release of TentSteak 0.1.0, a set of
Camping/Markaby helpers to minimize the busywork in your views (or
was that the "viewwork in your busies"?). It includes lotsa HTML
form and table helpers, plus a little bootstrapper to make it easy to
load in shared helper modules of your own.
Please check it out and let me know what you think.
2012 Sep 01
4
Basic Paypal
Hi all i am following this like for basic paypal
http://railscasts.com/episodes/141-paypal-basics
and i got this error
View:
<%= link_to "Checkout", @cart.paypal_url() %>
undefined method `paypal_url'' for nil:NilClass
despite i have this code in my model called Card
Cart Model:
class Cart < ActiveRecord::Base
def paypal_url(return_url)
values = {
2010 Apr 06
2
Authenticating against ActiveDirectory - can't read userPassword/unicodePwd?
Hello list,
So, the application I am working on right now needs to have LDAP
authentication build in, meaning that if the user enabled it, we will query
about his basic data (email,pwd) on a user-setup LDAP directory. It used to
work fine when I was testing with OpenLDAP. The code, essentially, is this:
connection.bind(self.bind_dn,self.password)
2008 Jun 09
6
Selenium/Watir usage along side Webrat in story testing
This is related to Selenium/Watir usage along side webrat in story
testing.
MHS_Testing and Rspec-ui provide some great help for testing through
frameworks like Selenium/Watir.
But there is something missing, Webrat has changed the landscape
somewhat with Acceptance Tests/Story Driven development.
Now I have a choice:
1. Tests and rails process run as one test process (Webrat)
2. Use