|
|
stackoverflow.com
- 2012-03-08 16:35:30
- Similar
- Report/Block
I've been unable to find much documentation or advice on writing good RSpec controller tests. Specifically, should you use Rails' assert_select which feels very unlike the RSpec or is there an alternative for it? Is the example below best practice? describe ArticlesController do render_views let(:article) { create(:article) } descr...
|
|
|
stackoverflow.com
- 2012-07-07 20:10:05
- Similar
- Report/Block
I just installed the SimpleCov gem to generate code coverage reports on my Rails 3.2.6 app, and it works great with RSpec, just not with Spork. I am able to get the desired correct report by running rspec --no-drb spec/ , but I'd like to also get them with Spork running using just rspec spec/ Given that there have been people who have ha...
|
|
|
stackoverflow.com
- 2012-03-23 00:58:03
- Similar
- Report/Block
We are currently running rspec tests that check for specific libraries/models to be loaded. Specifically, we want to test that when creating an object, we get the correct Watir object back: Watir::Browser for FF and Chrome, and Watir::Safari for Safari. We already tried doing this: Unload a ruby class but it just deletes the constant, wh...
|
|
|
|
stackoverflow.com
- 2011-11-08 23:52:55
- Similar
- Report/Block
I'm missing something here.... Cancan has a neat feature to automatically load your resources: (taken from https://github.com/ryanb/cancan/wiki/Aut horizing-Controller-Actions def index # @products automatically set to Product.accessible_by(current_ability) Except I can't figure out how to get this to work in my rspec controller specs...
|
|
|
stackoverflow.com
- 2012-04-10 14:35:30
- Similar
- Report/Block
In controller, def admin_search @admins = User.find(:all,:joins=>[:roles],:cond itions=>["name IN (?) and email like '#{params[:email]}%'",["content team","ops team"]]).paginate(:page => params[:page], :per_page => 10) please suggest me some code in rspec...
|
|
|
stackoverflow.com
- 2013-03-18 14:59:02
- Similar
- Report/Block
Rails 3.2, RSpec 2.11. Controller macro isn't working, and it appears to be written correctly from all the research I've done. Here's the code /spec/support/controller_macros.rb module ControllerMacros def login_user before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] user = FactoryGirl.create(:user) @current_use...
|
|
|
stackoverflow.com
- 2012-04-12 01:38:07
- Similar
- Report/Block
I am currently working on a Ruby project that comprises of a Redis DB, EventMachine and Sinatra (for a lightweight API). We're using RSpec for our testing and up until this point, everything has been going great. Now, however, we need to start talking (minimally) to a MySQL database. We've decided to go the route of ActiveRecord (just bec...
|
|
|
|
stackoverflow.com
- 2013-02-25 03:31:04
- Similar
- Report/Block
@consumer ||=OAuth::Consumer.new(OAUTH_CONFIG['oau th_key'],OAUTH_CONFIG['oauth_secret'],ac cess_token_url: OAUTH_CONFIG['oauth_access_token_url'],s ignature_method: 'HMAC-SHA1') I am working on a Rails web application. I am using Oauth to authenticate and i have a ruby API that interfaces with an api(JSON) to query and retrieve information.
|
|
|
stackoverflow.com
- 2012-06-01 01:07:20
- Similar
- Report/Block
After digging fairly deeply on this issue, I've come to an empasse between my understanding of the documentation and my results. According to https://www.relishapp.com/rspec/rspec-ra ils/v/2-8/docs/routing-specs/route-to-ma tcher , we should be able to write the following: #rspec-rails (2.8.1) #rspec (>= 1.3.1) #rspec-core (~> 2.8.0)...
|
|
|
stackoverflow.com
- 2013-03-02 11:29:08
- Similar
- Report/Block
What is the conceptual difference between Rspec's feature and request specs? From the feature spec docs: Feature specs are high-level tests meant to exercise slices of functionality through an application. They should drive the application only via its external interface, usually web pages. And for request specs: Request specs provide...
|
|
|
stackoverflow.com
- 2008-11-11 18:28:10
- Similar
- Report/Block
I'm working on a Spring MVC project, and I have unit tests for all of the various components in the source tree. For example, if I have a controller HomeController , which needs to have a LoginService injected into it, then in my unit test HomeControllerTest I simply instantiate the object as normal (outside of Spring) and inject the pr...
|
|
|
stackoverflow.com
- 2013-03-22 10:46:31
- Similar
- Report/Block
I've a couple of forms in my Symfony2 site that are currently embedded in a Twig template. I mean that these forms are associated with a Action function in my controller that is called in a Twig template like this: {% render url ("edit_profile_userB_form", { 'id': userB.id }) %} It actually works perfectly except in the case of I enter a...
|
|
|
|
stackoverflow.com
- 2012-02-02 16:21:22
- Similar
- Report/Block
I have Ruby on Rails 3.1 application and i use for Sphinx + Thinking sphinx for searching. For testing i use RSpec + autotest. I want to test my searching. Where can i read how to test my app right via rspec?...
|
|
|
stackoverflow.com
- 2012-05-08 17:15:38
- Similar
- Report/Block
I have a model class that caches some data in redis. The first time I call a method on the model, it computes a JSON/Hash value, then it stores it in Redis. Under certain circumstances I 'flush' that data and it gets recomputed on the next call. Here's the code snippet similar to the one I use to store the data in Redis: def cache_data s...
|
|
|
stackoverflow.com
- 2012-02-27 02:36:40
- Similar
- Report/Block
I'm working on a rails 3.2 app that uses rspec, devise and capybara under ruby 1.9.3 I've having a lot of problems for test for logging when using capybara, I mean when using the js: true metada on a test. first, in a test, logging through capybara with the fill_in click_button methods, it works when there's not the js: true metadata , a...
|
|
|
stackoverflow.com
- 2011-02-16 15:28:19
- Similar
- Report/Block
I was trying to test a simple index view, which has following code inside: - if can? :destroy, MyModel %th Options MyModelsController has following options (Inherited Resources + CanCan + Devise): class MyModelsController < ApplicationController inherit_resources nested_belongs_to :mymodel before_filter :authenticate_user! load_and_...
|
|
|
stackoverflow.com
- 2013-03-22 09:05:50
- Similar
- Report/Block
I'm using the SVProgressHUD class ( https://github.com/samvermette/SVProgres sHUD ) and I got a Main View Controller with a button on it which is connected using a segue push with another view controller. In the Main View Controller I added this code: - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender [SVProgressHUD sho...
|
|
|
stackoverflow.com
- 2012-04-04 02:58:06
- Similar
- Report/Block
I have a view on a storyboard the has a button to perform a certain action. To perform this action though, the user must be logged in. The button handler tests if the user is logged in and performs one segue if YES and another if NO. The NO segues pushes to a login view controller. There is another segue connecting back to the first view...
|
|
|
|
techexams.net
- 2013-05-22 03:02:04
- Similar
- Report/Block
Hey everybody, I ordered Mike Meyer's All-In-One study guide from Amazon and it has just arrived. If I begin studying for the 801 and 802 tests this week, what's a realistic time frame to take the tests? I want to do the tests before returning to school in the fall. I've taken a computer hardware class before and have a long history with...
|
|
|
stackoverflow.com
- 2012-04-05 01:32:05
- Similar
- Report/Block
Hi i have a tab based application what i have done is put another view as the welcome screen and i've made it to load first, the problem is i dont know how to call the tabview controller from the view i have created. the presentmodal view controller it only show the firstview this is what i have in my .m file -(IBAction) next_OnClick Fi...
|
|
|
stackoverflow.com
- 2013-04-21 08:03:40
- Similar
- Report/Block
I recently started learning RoR and TDD, and am having trouble figuring out the best way to handle this scenario. I have an ActiveRecord model with two fields which share the same validations. How do I write an RSpec test which utilizes the same tests for the similar fields? "shared examples" looked like a promising feature to utilize in...
|
|
|
|
techguy.org
- 2013-03-25 03:21:59
- Similar
- Report/Block
This has me stumped. I have a old dell box for the kids (4300) with bios flashed to A06. I just added a second 40 gig Maxtor hdd for them as a slave on the primary controller (hooked up with 80 pin IDE cables). When I do this, in the bios under primary controller device 1 it reads the size of the hdd but not the model. Same for device 2 o...
|
|
|
stackoverflow.com
- 2012-07-07 18:24:16
- Similar
- Report/Block
I am trying to upgrade one of my Rails projects to Ruby 1.9.2 . All went pretty well, but one RSpec test broke. In this test I require a Ruby # file spec/models/my_lib_spec.rb require 'spec_helper' require 'lib/services/my_lib' describe "MyLib" do it "should do something" do The lib looks like this: # file lib/services/my_lib.rb class M...
|
|
|
stackoverflow.com
- 2012-02-23 05:01:59
- Similar
- Report/Block
I'd like to use rspec to test the validity of a serialized hash, but I'm not really sure how to go about it. Is there a way to verify that hash has specific keys and values? foo.rb class Foo < ActiveRecord::Base attr_accessor :bar serialize :bar foo_spec.rb: require 'spec_helper' describe Route do before { @foo = Foo.new(bar: {...
|
|
|
|
theawesomer.com
- 2012-10-24 14:00:48
- Similar
- Report/Block
This awesome looking gun controller designed for FPS games has motion control and even a kickback effect. Designed by David Kotkin, the man who made the Avenger . Skip to 3:17 in the video for the good part. Hat Tip Link Price: $89+ More Awesome Stuff for You to Click On: Super Angry Birds Controller The Controller Shop New Xbox 360 Contr...
|
|
|
stackoverflow.com
- 2011-07-27 12:37:00
- Similar
- Report/Block
Is there any good way to test a controller and model of Sub APP in Padrino with rspec? I am a newbie experimenting with Padrino and Mongoid ORM. Can anyone provide me the link for examples showing rspecs for Sub APP and Main APP in Padrino.
|
|
|
stackoverflow.com
- 2012-03-30 14:21:50
- Similar
- Report/Block
I have a situation where I need to watch the tests, gather information, and then build a report from the tests. The tests will be started via TeamCity. I create a TestWatcher object to listen for test results, and this TestWatcher is included in each JUnit class that contains tests. I had a listener which would listen to when the entire s...
|
|
|
|
stackoverflow.com
- 2012-02-29 13:54:31
- Similar
- Report/Block
I am new to Rails Testing Can anybody suggest a good reference link or some help to explain how I can start RSpec testing for my new project in Rails?...
|
|
|
stackoverflow.com
- 2012-04-04 21:27:27
- Similar
- Report/Block
I'm trying to test a presenter method using a Capybara RSpec matcher. Lets say I have a method that renders a button. This would be the test I would write if I wasn't using capybara rspec matchers: it "should generate a button" do template.should_receive(:button_to).with ("Vote"). and_return("THE_HTML") subject.render_controls.should be...
|
|
|
gigaom.com
- 2013-05-06 06:01:01
- Similar
- Report/Block
Following Juniper Networks’ acquisition of software-defined networking (SDN) startup Contrail, the company’s new JunosV Contrail controller for software-defined networking is now being deployed in beta tests with AT&T, the China Mobile Research Institute and other enterprises and service providers. The controller will become broadly avai...
|
|
|
|
babyandbump.com
- 2013-03-15 16:43:38
- Similar
- Report/Block
Hi, I just selling these last tests or I will pee on them! There is 2 clearblue digis with conception indication, still in wrapper. And also 4 midstream 20 miu tests with instructions. £10 all in. (post in UK only) PM me x...
|
|
|
stackoverflow.com
- 2012-03-31 02:23:14
- Similar
- Report/Block
Consider this controller method from an ASP.Net MVC3 project: Having run dotCover code coverage, the Details method has clearly been covered by a test, as indicated by the green highlighting (arrowed). However, when I try to use ReSharper to navigate to "covering tests", it reports no coverage: dotCover clearly knows which tests have cove...
|
|
|
stackoverflow.com
- 2012-04-19 17:06:31
- Similar
- Report/Block
in my Play project I have some junit tests. Earlier this week I've been able to run the test from within play console using command. I could see the successes and failures. Unfortunately when I'd tried to run the tests today I've got: [info] No tests to run for test:test [success] Total time: 3 s, completed Apr 19, 2012 5:00:00 PM message...
|
|
|
|
stackoverflow.com
- 2012-05-05 10:12:16
- Similar
- Report/Block
I need to test if client includes POINTS array in post-request. When I test it with RESTClient plugin for firefox, I do it like this: POINTS[]=1.111111,2.222222,77 and it works. Now I need to test it via rspec, but I can't figure out how to do it. Here is my rspec test request: post :event, DISTANCE: "12345", POINTS: { "1" => "1.111111...
|
|
|
stackoverflow.com
- 2012-04-23 00:56:30
- Similar
- Report/Block
I've used MVC Scaffolding in the past and it has worked well. I'm starting a new MVC 3 project so I installed MVCScaffolding via Nuget. Iusing Nuget 1.7 and installed MVCScaffodling 1.0.6 however if I try to run I've created a simple 'Person' class that only consists of two properties. public class Test public int testID { get; set; }...
|
|
|
stackoverflow.com
- 2012-02-28 04:06:22
- Similar
- Report/Block
I'm quite new to rails, and trying to follow the railstutorial. Everything goes fine, except for my tests which can't get past the named routes (5.3.3) My routes.rb : SampleApp::Application.routes.draw do resources :users match '/signup', to: 'users#new' match '/help', to: 'static_pages#help' match '/about', to: 'static_pages#a...
|
|
|
|
stackoverflow.com
- 2013-02-26 18:00:02
- Similar
- Report/Block
I mean let's say we have a basic controller for the whole app, which is loaded every time: Base Controller Is the name "Base Controller" the official PHP term/nameing convention or something else (e.g. Basic Controller, Main Controller)? Then a controller which is loaded for frontend part called: Frontend Controller I was thinking that ma...
|
|
|
stackoverflow.com
- 2010-08-24 16:06:40
- Similar
- Report/Block
I'm writing and running my tests on VS2010 with mstest. When I want to run a test, or entire tests in a class, sometimes Visual Studio decides to run my tests. Why is that? How can I avoid it? Any tips?...
|
|
|
helifreak.com
- 2013-06-03 11:22:54
- Similar
- Report/Block
The Vortex is the only FBL unit that I know of which has a two-piece design. 1st question: Am I correct in assuming that all the gyro detection and vibration detection electronics is in the sensor? 2nd question: If the gyro electronics is in theh sensor, is there any constraints on the positioning and mounting of the controller. I am gues...
|
|
|
|
cyberforum.ru
- 2013-03-19 09:18:30
- Similar
- Report/Block
После ~$ heroku login Выдает: /usr/lib/ruby/vendor_ruby/1.8/rubygems/d ependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [abstract-1.0.0, actionmailer-3.0.9, actionpack-3.0.9, activemodel-3.0.9, activerecord-3.0.9, activeresource-3.0.9, activesupport-3.0.9, annotate-2.4.0, arel-2.0.10, builder-2.1.2, bundler-1.2.0, diff-...
|