Displaying 3 results from an estimated 3 matches for "current_project".
2006 May 07
0
NoMethodError trying to get ApplicationHelper method from a functional test
I am a little confused by the includes I suspect. In the book, it states
that runtime environment will load the directories app, app/models,
app/controllers, app/helpers, app/apis, components, config, lib, vendor and
vendor/rails/*.
However, when I try to access my "current_project" public method, it fails
with a NoMethodError.
What is even stranger is that I can use reflection to find that the method
is indeed there. For instance, this code:
def test_should_login_and_redirect
ApplicationHelper.public_instance_methods.each do |method|
if method == "cur...
2007 Jan 29
0
mock.with(Hash) expects an Array ?
...searched the archives. And I can''t
believe someone didn''t hit on this before.
Here''s my spec:
context "A project owner" do
controller_name :roles
setup do
controller.stub!(:current_user).and_return(@user = mock("user"))
controller.stub!(:current_project).and_return(@project = mock("project"))
@user.stub!(:role_on).and_return(Role.owner)
end
specify "can change the role of a user" do
@project.should_receive(:roles).and_return(roles_proxy =
mock("roles proxy"))
roles_proxy.should_receive(:find).with(&qu...
2008 Sep 26
6
BDD / cucumber thought - chaining ''Then'' steps with Which
Going back to the debate about keeping state between steps, I found
myself with the mild urge to be able to write this today:
Given there is a user
And the user has 20 friends
Then I should see a thumbnail of each of the users''s friends
Which should be a link to the user profile page for that friend
NB: An idiom in this which may be songkick-only but was inspired by
what