similar to: Can not

Displaying 20 results from an estimated 200000 matches similar to: "Can not"

2007 Sep 14
6
Need help in View Spec
Hello everyone: I am kind of puzzled in writing spec on view partials. I can not find much information about the "should have_tag" syntax in Rspec. Can rspec test a particular attribute of a tag (e.g. input tag)? Let me put an example here: #../view/group/_index <div id="test"> <input type="button" value="update" onclick="update()"
2007 Aug 31
2
Can module spec "behave like" controller spec?
Hello everyone: Right now I am writing spec on modules, which are provided by my colleagues. Some of the modules actually contain action methods. I tried very hard to spec those action methods in modules. But it seems that the rspec does not allow module spec to ''get'' action like controller does. After I saw the documentation, I then used :behaviour_type=>:controller.
2007 Sep 12
8
Can not ''assigns'' value in View test
Hello everyone: I am quit new to View test using rspec. I want to write spec for a partial, which is rendered by a controller. However, the controller does not pass data to the partial using instance variables, it uses symbol variable instead. I read the example of view spec provided in the website. But the example is using instance variable. So I am looking for a way of assigning my test data
2007 Aug 22
1
Can Rspec do module spec? What if module uses test data?
Dear fellows: I am currently working on writing specs on some ruby modules(e.g. myModule). At first I try to use script/generate to generate rspec_module, but it failed. :-( Later I manually created a file (e.g. named myModule_spec.rb) and put the ''require ....spec_helper.rb'' as the first line of code followed by ''describe'' block. Luckily, it seemed to
2007 Aug 23
1
Can module spec use fixtures?
Good morning, dear fellows: I''d like to recall one question I posted yesterday. I am writing specs for ruby modules. Some of the modules do some data process in the test database. Because ''fixtures'' is undefined (Am I correct?) in module specs, spec of certain module (e.g. delete data form database) will affect other specs of other modules (e.g. try to access the
2007 Aug 13
8
How to use expect_render?
Hi: I am a rspec beginner. I have scratched my head for the whole afternoon, trying to figure out a way of writing render expectation in controller spec. However, I failed. It kept telling me that the ''expect_render'' was an undefined method. I have installed rspec 1.0.8 and rspec_on_rails as well. Below is the controller to be tested. Controller def index pre
2007 Aug 07
1
Rspec controller test
Great Hi to everybody! I am currently working on a project which tests the controllers using rspec. I came across some methods in the controller which do not generate any actions at all. However, they still need testing! Some of these methods do require parameters. I am wondering how I can pass the test cases as the parameters to these targeted methods in the controller spec?? Below is a simple
2007 Aug 13
1
Problem of using fixture in Rspec
Dear Fellows: I was using fixtures in the model tests using Rspec. I found that the test data specified in the fixtures was stored in the test database once I ran the spec and won''t be removed anyway. Is my observation correct? There might be another problem regarding the fixtures. When I ran the specs one by one, it was working. However, it failed when I tried to run all the
2007 Sep 24
2
Is Rcov working with Jruby now?
Hello everyone: I am currently assigned to test a big project which uses JRuby to build a web application. The reason of using JRuby is the web application is communicating with Java Service. I am writing test cases using Rspec and looking for a code coverage tool. Rcov is no doubt a nice code coverage tool. However, it is said that Rcov is not compatible with JRuby so far. Sigh....I can not
2007 Aug 08
1
Failed to pass arguments to controller method
Good morning to everyone: So weird!! I got a method called apply_settings(arg1, arg2) in the controller to be tested. In the controller spec, I of course called the method. In the controller: def apply_settings(arg1, arg2) #where arg1 is a hash, and arg2 is an array of object #do some coding end In the controller spec: before(:each) do @controller = Controller.new
2007 Aug 10
1
Can''t get should redirect_to match to work
Folks, I''ve posted to the simple example I''m working with as well as the spec code and results here: http://pastie.caboo.se/86750 I can''t seem to get this to work. Any ideas? Thanks, Scott -- View this message in context: http://www.nabble.com/Can%27t-get-should-redirect_to-match-to-work-tf4251891.html#a12101072 Sent from the rspec-users mailing list archive at
2007 Oct 08
0
Can''t debug specs in Netbeans
Hi. I can''t seem to get debugging of specs working in Netbeans. AFAIK, I''m supposed to be able to just do Command+Shift+F5 with the spec open in the editor but i get this error: /Users/admin/src/expresso/vendor/plugins/rspec/lib/spec/test/unit/autorunner.rb:2:in `remove_method'': method `process_args'' not defined in Test::Unit::AutoRunner (NameError)
2007 Aug 14
2
Spec''ing ApplicationController
Folks, I''d like to spec the behaviors that I''m adding to ApplicationController. Specifically, I''m adding: def authenticated? session[:username] != nil end I described ApplicationController, but couldn''t figure out how to call the authenticated method. I''m probably going about this quite wrongly and would appreciate any hints? Thanks, Scott --
2007 Sep 27
1
rspec_on_rails: controller method not getting called
In my rspec_on_rails controlle rspec, I have this: require File.dirname(__FILE__) + ''/../spec_helper'' describe FooController, "with a foo" do it "should be false" do get ''index'' assigns[:foo].should be_false end end In my controller I have this: class FooController < ApplicationController def index @foo = FALSE end
2006 Dec 23
2
Having trouble installing the Rails plugin with Rspec 0.7.5
Hi, I''m running Rails 1.1.6 and just installed RSpec 0.7.5. When I try to install the appropriate Rails plugin, it just says that "Export Complete" and doesn''t install anything to vendor. I can do it with older version, but then it''s not compatible with RSpec. Any ideas? blissdev:~/code/rails/client/wordone > ruby script/plugin install
2008 Jan 31
1
RSpec and the Basecamp API
I realise that this is kind of a basic question but I''m new to rspec and still trying to work out how to do things. I''m working on a rails project that requires basecamp integration via the api, which is fairly trivial to use via the basecamp.rb wrapper: Connection: basecamp = Basecamp.new(APP_CONFIG[''api_host''], APP_CONFIG[''api_username''],
2010 Jun 23
1
RSpec, plugins and stubbing controller methods
Hello, I have some code that is going to be used in other applications, so I decided to bundle the code (mostly controllers and views) into a plugin to make sharing easier. I copied the RSpec tests for the controllers into the plugin as well. The plugin RSpec tests run, however when it gets to stubbing controller methods it does not work. For example:
2007 Jan 29
2
rspec and cookies
Hello can anyone tell me how to test cookies using rspec? specifically, I''d like to be able to set a cookie before a get/post request and also to test the cookies which have been set by a get/post request I know I can use cookies[:name] = ''value'' to set a cookie but how would I set expiry information on such a cookie? when i try to pass a hash {:value =>
2007 Nov 01
2
Can''t use #exactly when #and_return influences it.
I want my class Reader to loop on the content of its Stack until false is returned. I also want an optional argument to exist that limits how many times the stack will be read, even if some elements are left. I was trying to spec this last bit but ended up on a false positive. Hope the example will be clear enough: #spec_reader.rb describe Reader do it "should stop reading items when
2008 Jun 06
2
`exit?'': undefined method `run?'' for Test::Unit:Module (NoMethodError)?
Why am I getting this error if running from Netbeans or just from command line with executing blah_spec.rb? If I run with spec bla blah blah_spec.rb then it''s fine. . Finished in 0.264 seconds 1 example, 0 failures c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec.rb:27:in `exit?'': undefined method `run?'' for Test::Unit:Module (NoMethodError) from