Displaying 20 results from an estimated 300 matches similar to: "Functional tests and active scaffold: unexpected assertion failure."
2007 Jun 22
5
assert_select trying to verify the presence of a textarea
Hello,
One of my functional tests looks like this:
def test_presence_of_free_text
profile = Profile.find :first
post :edit, {:id => profile.id}
assert_select "textarea", :name => "record[free_text_ec]"
end
The test results in a failure, because the element cannot be found.
I''m pretty sure the element should be there, and I''ve tried
2008 Jan 21
9
DRY act_as_authenticated functional testing
I''m using the acts_as_authenticated plug-in for my app. Now I need to
get my functional tests to work properly. I have not written functional
tests before so I''m unsure how to utilize setup so that all of my tests
can use the login. My tests pass if I put login_as :user inside of each
test, but that''s clearly not DRY. Can I add something to my
test_helper.rb file or
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2007 Feb 28
4
acts_as_authenticated error with Object#id
I''m getting this when I run my Rails controller specs.
<projectroot>/config/../lib/authenticated_system.rb:16: warning: Object#id
will be deprecated; use Object#object_id
I added "include AuthenticatedTestHelper" to /spec/spec_helper.rb so
that my controller tests^H^H^H^H^Hspecs can use the "login_as" helper
method. Anyone know how to fix this?
--
Cheers,
2007 Sep 13
5
Authenticating before tests
Hi all,
I''m using Goldberg, an engine that provides roles based access
control for my app. I need to login before I can do controller tests,
but I can''t find any examples of people doing this.
Could someone point me in the right direction?
I thought the simplest way would be to either call the login action
from my other tests before(:all), but I can''t seem to
2007 Oct 11
2
Login testing ideas
I''ve been going through Pat''s example story and noticed that there was
no checking for a bad login. I assume this is because that would have
made the article bigger and more complicated than it needed to be.
So the question that comes of of this is:
How do folks normally handle the negative case? My plan was to just
use another scenario, but as a new person to BDD/TDD,
2008 Mar 20
5
sharing story steps
Hi,
How can I have a common set of steps that all my stories share?
i.e. My stories often start out looking like this:
Given a user Joe
Given a user Jordan
then:
Given("a user $username") do |username|
@users ||= {}
@user_sessions ||= {}
@users[username] = create_user(:username => username)
@user_sessions[username] = login_as(@users[username])
end
I want to share that
2007 Oct 26
2
Examples of writing controller specs that use authentication
Hello,
I''m working on specs for a controller that handles authentication
using the restful_authentication plugin. I''m trying to find a
resource (tutorial or examples, if possible) about the best way to go
about writing mocks and specs to make sure that things like my
before_filters are working correctly. Does anyone know of any good
resources for this?
Thanks,
Les
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded
today) and upon running the generator, doing the migration, prepping
the test system and putting the resources in routes.rb I get a Rspec
test failure:
''SessionsController logins and redirects'' FAILED
expected not nil, got nil
routes.rb has:
map.resources :users
map.resources :sessions
nothing else was
2007 Sep 30
9
Problems with testing nested routes using mocking
Hello forum
I have there to files
#----- virtual_host_controller.rb
class VirtualHostsController < ApplicationController
before_filter :capture_domain
# GET /domain/1/virtual_hosts/1
def show
@virtual_host = @domain.virtual_hosts.find(params[:id])
respond_to do |format|
format.html # show.rhtml
end
end
private
def capture_domain
if
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
2007 May 30
6
authentication mocks
hi
I''m using restful_authentication
and have controller specs working using users fixtures (and login_as)
however i''ve been trying for hours without success to do it without
fixtures, using mocks and stubs instead.
anyone here done this? got code?
:)
thanks
2006 Nov 08
1
controller.session not same as session?
> context "A user logging out" do
> fixtures :users
> controller_name :account
>
> setup do
> login_as :quentin
> users(:quentin).remember_me
> request.cookies["auth_token"] = cookie_for(:quentin)
> end
>
> def logout
> get :logout
> end
>
> specify "should unset :user in session" do
2012 Sep 13
5
random sampling inside a dataset
Hi all,
I am wondering if do exist a function in R that allow me to sample or
choose randomly the rows (i.e., samples) inside a given matrix.
Thank you very much in advance.
Cheers,
--
Gian
[[alternative HTML version deleted]]
2014 Mar 05
1
Running configure from subdirectory of source tree
Hello everyone,
I would like to seek your advice regarding a build (or rather "configure")
problem I am running into. For reference, tests are all relative to a build
from a 1.8.26.0 tarball, on Debian Wheezy.
I would like to understand if it is possible, and if any of you have tried,
to build Asterisk from a subdirectory of the source tree, i.e., from a
clean source tree
# mkdir
2013 Mar 14
2
how to import DNA sequences in R
Dear all,
I was wondering how to read DNA sequences in R, is there a specific
function and/or a specific package for that?
Thank you very much in advance,
Gian
**
[[alternative HTML version deleted]]
2013 Mar 14
3
column and line graphs in R
Hi all,
I would love to plot my data with R. I have abundance and frequency of fungal
taxonomic data that should be plotted in the same graph. In Microsoft Excel
is that possible but the graphic result is, as always, very poor. Is there
a function that may let me plot these data in R?
I have a matrix made of two columns, on is the relative abundance and the
other is the relative frequency for
2013 Nov 26
1
Zabbix + samba4
Hello there,
I'd like to know if there are some way to gather statistics from samba4,
like quantities of active users and other things that it can offer then
use it in zabbix to generate some graphs and triggers.
I can do somethings in smbstatus of samba3, but i couldn't find anything
like this in samba4.
is there anybody here who could do it?
Thank's a bunch!
--
*Gian Luca
2007 Oct 16
10
Scenarios Plugin Pre-Announcement
This is sort of a pre-announcement for a Rails plugin my friend Adam
Williams and I are working on. We''re in the process of extracting it
from a project we are working on so that it can be generally useful to
the Rails community. We are calling it "Scenarios". It is a drop in
replacement for Rails fixtures:
http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README
2012 Feb 16
2
help with e+01 number abbreviations
Dear List,
I will appreciate any advice regarding how to convert the following numbers
[I got in return by taxondive()] in numeric integers without the e.g.
6.4836e+01
abbreviations.
Thank you very much in advance,
Gian
> taxa_dive
Species Delta Delta* Lambda+ Delta+ S
Delta+
Nat1 5.0000e+00 6.4836e+01 9.5412e+01 6.7753e+02 8.7398e+01
436.99
Nat2