search for: mikerin

Displaying 16 results from an estimated 16 matches for "mikerin".

Did you mean: mikeliu
2011 Sep 07
4
rspec testing inheritance
Hello, Is there any way to test model inheritance in spec? something like.. it { ChildModel.should < ParentModel } thanks.
2011 Feb 02
6
how to set default_scope for the whole application?
I know I can set default_scope for individual active record model, but can I set one up for the whole application? thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2011 Aug 28
1
troubles running rspec..
developing a 3.1 app. trying to run spec on and get this error: bundle exec rake spec ***************************************************************** DEPRECATION WARNING: you are using a deprecated constant that will be removed from a future version of RSpec. /home/slava/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.18/lib/bundler/ runtime.rb:68:in `require'' * Rspec is deprecated. *
2011 Sep 14
1
rspec and should have_many through
Hi, Anyone can help me with rspec shoulda validations please. I can''t get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as => :source } this is for Rspec 2, rails 3.1, gem "rspec-rails" gem
2009 Sep 28
1
filter activeresource response body
Hello, I have an ActiveResource model that loads imperfectly structured json from a third party service. I need to catch response before its parsed by the model and make a few corrections on the json. How should I go about doing this? thanks, Slava
2011 Oct 12
1
scopes related question
Hello, Have a question related scope definition. I need to define a scope based on related model attribute values like this. class Product < ActiveRecord::Base belongs_to :currency scope :with_currency, lambda { |currency| unless currency.to_s.upcase == ''ALL'' # here I need to define a scope that would test for currency.char_code to match a passed value # something
2011 Oct 12
1
`require': no such file to load -- rspec/rails (LoadError)
Getting strange loading problem.. >> bundle exec rspec -p spec/models/* give error: .. .rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/ dependencies.rb:240:in `require'': no such file to load -- rspec/rails (LoadError) from /home/slava/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/ lib/active_support/dependencies.rb:240:in `block in require'' from
2008 Dec 21
0
cucumber and selenium
hello, I am starting out with cucumber and selenium. Whenever I run a rake features on my features or on cucumber/examples/selenium/features too many browser windows start... for example if run cucumber examples/selenium/features 3 browser windows get launched. I commented out browser closing after tests to see exactly how many windows and for a simple google search feature I ended up with 3
2011 Sep 04
3
rspec assert inclusion in..
hello, I would like to assert that an attribute of a model has value among those in an array. How would I do it in rspec? Something like this... describe OptionType do context "shoulda validations" do it { assert_contains :type, [''Type1'', ''Type1'']} end end
2011 Sep 04
0
should validate_numericality_of with greater_than_or_equal_to
Hello, I have this in my spec it { should validate_numericality_of(:amount).greater_than_or_equal_to(0) } but I get error: Failure/Error: it { should validate_numericality_of(:amount).greater_than_or_equal_to(0) } NoMethodError: undefined method `greater_than_or_equal_to'' for #<RSpec::Matchers::Matcher:0xef23150> this page
2011 Sep 05
0
undefined method `dependent' - rspec and shoulda
hello, Getting this error when using shoulda and rspec for model tests. my gemfile ... gem "shoulda-matchers" .. spec file .. it { should have_many(:balances).dependent(:destroy) } error: User shoulda validations Failure/Error: it { should have_many(:balances).dependent(:destroy) } NoMethodError: undefined method `dependent'' for
2009 Jun 12
0
sap4rails
Hello, I need to integrate my Rails app with SAP back-end. I found this library sap4rails, which apperenty is meant to help, but I see that the library has not been modified since 07, and wonder if it is up-to- date. http://raa.ruby-lang.org/project/sap4rails Does anyone have experience working with this library and is it a good solution for Rails and SAP integration? Any relevant tips please.
2011 Mar 09
1
&quot; instead of " in js code rendered by erb
Having problems rendering javascript in erb file. Thanks for suggestions. //layout erb file (function() { ... var widget_properties = {}; <%= content_for?(:extend_widget) ? "widget_properties = " + yield(:extend_widget) : '''' %> ... })(); //view erb file <% content_for :extend_widget do %> extend = { _init: function() {
2011 Aug 21
0
basic http authentication
Hi, I used code from http://railscasts.com/episodes/82-http-basic-authentication but added it to Application controller to apply to the whole application class ApplicationController < ActionController::Base protect_from_forgery before_filter :authenticate protected def authenticate puts ''authenticating.. '' authenticate_or_request_with_http_basic do |username,
2011 Nov 10
1
url helper in model.js.erb.cofee (Sprockets::Context)
hello, I am writing a js/coffee file that gets erb handling and I need to use a url helper inside this file if write .. url: ''<%= url_for(:action => :index) %>'' I get an error: NoMethodError Exception: undefined method `url_for'' for #<#<Class: 0xbdbb068>:0xeed1eb8> >>self.class #<Class:0xbdbb068> < Sprockets::Context How do I
2005 Dec 28
2
cant get X on domainU
Hello I can''t seem to be able to get X working on domain U My setup domain0 -ubuntu breezy domainU -ubuntu breezy I tried 3 techniques 1. ssh -X domainU steps: on domain U $ export DISPLAY=:0 $ xhost + xhost: unable to open display ":0" on domain0 ssh -X domainU result: ssh conection established no X forwarding starts. after login tried