27;, expecting
keyword_end (SyntaxError) ...:name => "brand[created_by]", , false
It looks as if any attempts I make to denote that I have no 'values'
to give to it is not working.
Can someone please tell me what the right syntax is for saying, "i
expect not to see the brand[created_by]" input attribute at all in the
rendered form for adding new entries?
Thank you :)
Gordon
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hi, there,
I believe I have some problem with scoping.
I have a controller spec file which tests a brands resource.
At the start of the file, I test the resource's access for different
users in a context block
a) not signed in
b) non-admin user signed in- I call my own helper method, login
>
> I don't know if you can. Maybe somebody on the Rails list knows.
If it can't, it means that people can't use assert_select to expect
NOT to find a given element with extra attributes (such as :name)
being defined. If that's the case, i think assert_select was either
poorly written OR not com
Hi, all :)
I have some working support helpers defined in spec/support/
controller_macros.rb.
I'm running "rake spec" before a 'git commit' and observed that the
spec request for my 'brands' controller,
spec/requests/brands_spec.rb fails because a support helper method I
defined in spec/support/
Hi, there,
I believe I have some problem with scoping.
I have a controller spec file which tests a brands resource.
At the start of the file, I test the resource's access for different
users in a context block
a) not signed in
b) non-admin user signed in- I call my own helper method, login_
> Let's see the helper method please.
---spec/support/controller_macros.rb: start --
module ControllerMacros
include Devise::TestHelpers
# sets up an instance of a non-admin user
def login_user
before(:each) do
@request.env["devise.mapping"] = Devise.mappin
Hi guys,
I have created a new resource, brands and here's the spec for 'new'
which is failing.
I do not know what's going on despite checking it out for a few times
already
-- app/views/brands/new.html.erb - start -
New brand
<%= render 'form' %>
<%= link_to 'Back', brands_p
Fixed the issue as soon as I walked off my desk.
Thought it was because of the resource object, @brand in spec/views/
parts/new.html.erb_spec.rb not being stubbed properly.
Checked and I was right :)
So,
before(:each) do
@brand = assign( :brand,
stub_model( Brand,
My advance apologies if the title/subject is not too descriptive.
Pre: I have just upgraded from rails 3.0.9 to rails 3.1.0
Before the upgrade, running 'rake spec' sees all my specs pass.
After the upgrade, I seem to encounter some errors:
-- Error extracts start ---
Hi guys,
I tried reading up the RSPEC Book (Dec 2010) and googled a bit but I
could not find anything.
I'm using Rspec2.
Example:
spec/factories/categories.rb
==
FactoryGirl.define do
factory :category_intakes, :class => 'category' do
name'intakes and filter
hi, there
I have been looking at
https://www.relishapp.com/rspec/rspec-core/docs/helper-methods/define-helper-methods-in-a-module.
This is the documentation for usage of extend and include.
In the section, "Scenario: extend a module in only some example
groups",
I refer to the setup in RSpec.c
ner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
-- spec/spec_helper.rb end --
i am already extending it to the view (ie. 'config.extend
ControllerMacros, :type => :controller').
What am I missing?
Thank you
Gordon
__
hi guys,
In my index view specs for a given resource, I have successfully
written it for admin users.
For the given resource, when admin users are looking at the index
page, they should see
-a link to add a new resource object
-links to delete/edit/show for each resource object created
My index
hi, all,
the spec above is found in my controller spec for a 'category'
resource.
It's a generated spec.
- start extract
describe "PUT update" do
describe "with valid params" do
it "updates the requested category" do
catego
gories/:id(.:format)
{:action=>"destroy", :controller=>"categories"}
root /
--- routes end ---
The form partial has been properly fitted with the parent resource
and the nested resource (ie. "form_for [@category, @sub_category]" ).
It seems that it's calling a route, sub_category_path which I have
never specified.
The error comes up when an edit/create form is to be created where a
form partial is called.
I am really puzzled on why this is happening and have consulted the
search results I had via google for 'nested resources with rspec' ,
'Rails in Action 3' by Yehuda Katz, and the Rspec book :(
If anyone knows what I am missing, I would love to hear your thoughts.
thank you :)
Gordon
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
hi all :)
Found a spec failing today.
Not sure why.
When I run my application and successfully added a new object, i can
see
1) a redirection has taken place to the index page as expected (302
code returned) from the console
2) the flash notice's message being displayed in the index page
BUT
w
Hello David
Thanks for that. Doesn't assign have 2 arguments with the first being the
variable to be assigned to and the second being the contents?
On Aug 3, 2011 7:01 PM, "ct9a" wrote:
> also, i have just read a little more in the rspec book.
>
> here's an extract:
>
> - extract star
e' => 'Brake pads'}
flash[:notice].should eq('Part was successfully updated.')
end
end
Spec extract ends -
Thank you for your help, Justin!
Gordon Yeong :)
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> Do you have a before filter somewhere that is preventing the
> :update_attributes message from being received?
>
> I have checked my application's controllers
(app/controllers/application_controller.rb and
app/controllers/parts_controller.rb) and controller spec
(spec/controllers/parts_cont
>
> What _will_ work is this:
>
> assert_select "input#brand_created_by", false
>
>
Hmmm. Sadly it does not work :( See below:
extract start -
Failure/Error: assert_select "input#brand_created_by", false, :name =>
"brand[created_by]"
ArgumentErr
>
>
> This ^^ does include :name => "".
>
> What happens when you just run
>
> assert_select "input#brand_created_by", false
>
> this runs successfully but how do I do it with the :name? :( I just want to
be complete and explicit :)
___
rspec-users
It's just that I did not find my reply surface after 20 mins and was
wondering if it was lost.
Sorry about that, everyone :( my apologies.
On 14 October 2011 16:01, Justin Ko wrote:
>
> On Oct 13, 2011, at 8:59 PM, Gordon wrote:
>
> >
> >
> > Hi, there,
&
I think i answered my own question. :count refers to the number of fixture
objects.
The reason why :count => 2 was passing for views index specs is because 2
objects are being mocked and they are identical.
Hence, there are 2 stock tests:
1) asserts that there are 2 elements which have the
c.rb" again and all tests are passing.
Could it really be the stale Gemfile.lock file? hmmm
On 26 March 2012 21:47, Gordon wrote:
> hi all :)
>
> Found a spec failing today.
> Not sure why.
>
> When I run my application and successfully added a new object, i can
> see
24 matches
Mail list logo