Displaying 20 results from an estimated 200 matches similar to: "wrong number of arguments calling `request` (0 for 1) (ArgumentError)"
2008 Dec 10
1
Oddness with fieldnames containing an underscore
Hi all,
I''m not sure if this is a cucumber or webrat thing given that I only
starting tinkering with both last night for the first time (testing
newb as well), but I''ve come across an oddity when trying to write a
scenario to create a user.
Scenario: Register new user
Given I am on the new user page
And I fill in "login" with "fredf"
2012 Jun 14
3
response.should have_content("1 movie") does not seem to work for me
Hey everybody
I have worked quite to near the end of The RSpec Book, but now I''m
having some troubles.
I''m trying to get the last few Cucumber steps to work, which are:
Then /^Caddyshack should be in the Comedy genre$/ do
visit genres_path
click_link "Comedy"
save_and_open_page
response.should have_content("1 movie")
response.should
2007 Oct 26
1
Spec custom finders
I have some finders in my models where I write some of the sql myself. I
of course want to test these, but am not sure the best way. Should I just
let them roll through to the db, and verify they return the correct
objects based on the fixtures I load, or should I spec the actual query? I
know that DB access is sort of frowned upon, but is this a situation where
it is more or less acceptable? My
2008 Dec 02
4
Using Cucumber with latest Webrat
I added cucumber to my rails project using the following commands:
git submodule add git://github.com/aslakhellesoy/cucumber.git \
vendor/plugins/cucumber
ruby script/generate cucumber
git submodule add git://github.com/brynary/webrat.git \
vendor/plugins/webrat
git submodule add git://github.com/dchelimsky/rspec.git \
vendor/plugins/rspec
git submodule add
2009 Jul 06
3
Rspec book issue (mastermind example)
Hey Everyone,
Just a simple question. I have read and re-read the examples and I''m
not getting the proper output. I''m on page 73/74 of the Rspec book
and it says I should have "4 steps passed". I think the problem is
within my /step_definition/mastermind.rb" file. It''s definitely not
beyond me to make a mistake, but I have checked and double checked my
2010 Dec 16
1
Ambiguous match error for Cucumber
Hi,
I am trying out the cucumber tutorial
http://www.ultrasaurus.com/sarahblog/2008/12/rails-2-day-3-behavior-driven-development/
My tasklist.feature file is like as follows
"
Feature: Tasks
In order to keep track of tasks
People should be able to
Create a list of tasks
Scenario: List Tasks
Given that I have created a task "task 1"
When I go to the tasks page
Then I should see
2010 May 08
2
uninitialized constant - Please Help Me...
Hello everyone,
I''ve decided to take the step into creating a mini-forum for my
website where users can open new posts on exixting topics and allow
people to discuss things etc...
I am following a tutorial in the book: APRESS - Practical Rails Social
Networking Sites and have hit a minor issue.
Part of the Forum requirements is to add a moderator role to allow
only certain individuals
2009 Mar 30
2
[Cucumber] Bug with background
Seem to be getting a problem when running a feature with background. Running
the whole file works fine however running an individual feature fails. The
background steps are
Background:
Given an admin user Philip exists
When I login as Philip
Then I should be logged in as Philip
running the following scenario on its own causes an error
Scenario: Admin should be able to run a feed #
2013 Jun 18
1
Rails 3 in action book: some files are not generated as written in the book
I''m reading "Rails 3 in action", chapter 3, p. 56.
It is said that the Cucumber skeleton generator
> rails generate cucumber:install
has to also generate the definition for the first step of the Scenario
"Given I am on the homepage" in the file
"features/step_definitions/web_steps.rb"
# file: features/step_definitions/web_steps.rb
Given /^(?:|I )am on
2006 Jun 30
4
More idiomatic way of writing a filter
Is there a more elegant way of writing this?
def verify_user
@user = User.find_by_username params[:username]
if @user.nil?
message = xml.error do |xm|
xm.message "User does not exists: #{params[:username]}"
end
render :xml => message
return false
else
true
end
end
Thanks, Joel
--
2009 Mar 04
5
Sinitra 0.9.1 Webrat 0.4.2 Cuc problem
Have created sample sinatra cucumber app as suggested on wiki. Tried both
env.rb configurations from there and aslaks git repo. With this combination
of gems I get the following error doing basic cuc tests
When I visit ''/foo'' #
features/step_definitions/general.rb:1
PATH_INFO must start with / (Rack::Lint::LintError)
2009 Jan 16
16
Testing arbitrary post action parameters
I am working on our (newly renamed) authentication feature. The current
scenario is:
Scenario: Non-administrators should not set administrator ability
Given I have no users
And I add a user named "admin" as an administrator
And I add a user named "myuser" as not an administrator
When the user named "myuser" authenticates
And the user
2009 Sep 10
1
Bug#546004: logcheck-database: logcheck kernel "Treason uncloaked" filter doesn't catch ipv6 addresses.
Package: logcheck-database
Version: 1.2.69
Severity: normal
Tags: patch
kernel log lines of the form:
...kernel: [1933150.816604] TCP: Treason uncloaked!
Peer 0000:0000:0000:0000:0000:ffff:d04e:3f6b:4038/80 shrinks window
2491430013:2491430014. Repaired.
are not caught by the current rules.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500,
2010 Jan 12
8
tips on how to write a controller test for models associated with currently logged in user
I have a controller test here:
http://gist.github.com/275616, which works fine when account is an
independent model, however I want:
an account to be a property of user, ( and created and associated when
a user is)
when the user goes to /account/edit it should on edit the account of
the logged in user -
I can make rails do this, but I''m utterly baffled how I should alter
this test to
2012 Feb 02
1
Missing files with rails generate cucumber:install
when ranning cucumber:install
and generate me this files
<code>
create config/cucumber.yml
create script/cucumber
chmod script/cucumber
create features/step_definitions
create features/support
create features/support/env.rb
exist lib/tasks
create lib/tasks/cucumber.rake
gsub config/database.yml
gsub config/database.yml
force config/database.yml
</code>
im searching for the
2006 Jul 05
1
Routing via function
I have a route that depends on a username being passed in the URL, such as:
map.connect '':username'', :controller => ''user'', :action => ''show''
Is there a way to perform a lookup of the username before matching on
this route?
I am hoping to be able to do something like this (completely made up):
:requirements => {:username =>
2006 Jun 27
0
More idiomatic way of doing this
Folks,
I''m trying to write a validating filter that checks if the user
exists and renders XML if not. Most of the controllers will be
returning XML on some error or other so I''m including RenderError in
ApplicationController.
Is my approach a sound one? Also, is there a shorter and more
idiomatic way of writing this:
if @user.nil?
render_user_exists
2006 Apr 11
0
a user model in all controllers in 6 lines of code
Well it took a bit of research, and making a fool out of myself; but I
found a way to get a user model from the session and have it
accessible in every controller and view in 6 lines of code.
In the ApplicationController write
model :user
before_filter :set_user
private
def set_user
@user = session[:user] ||= User.find_by_username(''nobody'')
end
I have redeemed myself
2006 Jan 20
0
How to update two records ?
I have problem to update personaldata accessing with/from @user.
''@debug @user'' shows that @user.personaldata attributes are properlly
modified, but ''@user.save'' saves only table users but not personaldatas
Is a problem with my associations? How to save personaldata with
@user.save ?
class User < ActiveRecord::Base
has_one :personaldata
end
class
2009 Jan 09
1
Is there a problem with webrat?
webrat (0.3.4)
I have this in the view:
<div id="list_entity_1">
<tr>
<td>Just An Entity</td>
<td>000001</td>
<td id="show_entity_1"><a href="/entities/1">Show Entity</a></td>
<td id="edit_entity_1"><a href="/entities/1/edit">Edit
Entity</a></td>