similar to: Spec''ing controller macros

Displaying 20 results from an estimated 1100 matches similar to: "Spec''ing controller macros"

2009 Feb 09
3
can't call request.remote_ip from object?
class User def update_metadata self.update_attributes({:last_login_at => Time.now, :last_known_up => request.remote_ip, :last_known_user_agent => request.user_agent}) end This does not work. It bombs out with: undefined local variable or method `request'' for #<User:0x1e146e0> But the request calls work in a
2008 May 02
4
spec''ing calls to super (or other Ruby keywords)
Hi there, How does one spec an invocation of a Ruby keyword, such as super in this case? class User < ActiveResource::Base # faking the ActiveRecord before/after_save observers def save super UserMailer.deliver_activation(self) if recently_activated? end end Does the solution look anything like the following? describe User do describe ''#save'' do it
2015 Jun 18
1
error trying to get PJSIP working
I'm doing an upgrade from Asterisk 11 to 13. I'm following the guide at https://wiki.asterisk.org/wiki/display/ast/setting+up+PJSIP+REaltime to setup realtime, as I use realtime on Asterisk 11 too. I'm getting the following error when trying to connect the peer to the server. Help? :) Thanks, Travis [Jun 15 16:20:03] NOTICE[5116] res_odbc.c: res_odbc: Connected to laf [laf] [Jun
2020 May 14
2
can't stream Opus in CAF format
Using FFmpeg, I can stream to a file on disk okay: c:\apps\ffmpeg\bin\ffmpeg.exe -f dshow -i audio="Line In (Realtek High Definition Audio)" -c:a libopus -ac 1 -b:a 32000 live.caf But, if I add Icey metadata, FFmpeg throws errors: c:\apps\ffmpeg\bin\ffmpeg.exe -f dshow -i audio="Line In (Realtek High Definition Audio)" -c:a libopus -ac 1 -b:a 32000^ -ice_name
2019 Jul 11
2
Need help with streaming to Icecast
Hi, I am having problems with sending a video stream to Icecast server. On the icecast management platform my stream is being considered as an audio stream?? and I am unable to play it I am with no ideas on how to solve this. Am I doing something wrong? Please take a look on the code bellow Thanks in advance genre various listener_peak 0 listeners 0 listenurl http://192.168.11.61:8000/gcs.ogg
2006 Aug 13
3
Render nothing; go nowhere
I am building an application that requires a C++ program to access the Rails web application using POST. Now, I just added user authentication to the mix and it has made things more interesting. I''m using basic authentication as shown in the AWDWR and Rails Recipes books. I can now get my C++ program to submit the user credentials to the login/login page. All I want the login page
2007 May 12
3
Setting form-values
Hi, I''ve recently had some trouble setting form values in my code - for example: require ''rubygems'' require ''mechanize'' def save(pagename, content, editsummary = '''') agent = WWW::Mechanize.new agent.user_agent = ''Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'' page =
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi I just did an update to lates trunk ================= context "Given a generated venue_spec.rb with fixtures loaded" do fixtures :venues specify "fixtures should load two Venues" do Venue.should have(2).records end end ================== gives me ========== 1) TypeError in ''Given a generated venue_spec.rb with fixtures loaded fixtures should load two
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
2019 Jul 11
1
Need help with streaming to Icecast
Hi Martin, Yes, I am using ffmpeg icecast protocol Marvin Scholz <epirat07 at gmail.com> escreveu em qui, 11/07/2019 às 20:53 : > On 11 Jul 2019, at 20:50, Pedro Constantino wrote: > > > Hi, > > > > I am having problems with sending a video stream to Icecast server. On > > the > > icecast management platform my stream is being considered as an audio
2007 Mar 10
2
upgrading rails to 1.2.2 giving me mongrel errors
I''m working on upgrading to rails 1.2.2 from 1.1.6 and getting the mongrel error below in development mode. Now things seem to work fine with 1.1.6and 1.2.2 (in prod mode). Any ideas what might cause this? Googling gave me very little to work with. This was the closest thing i found http://dev.rubyonrails.org/ticket/6716 I''m running Ubuntu with mongrel 1.0.1 and fastthread
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 --
2006 Apr 29
1
reloading include-modules inside controller not working
Hi guys, I would expect an ActionController-derived class to reload _completely_ in development mode. class FooController < ApplicationController include FancyStuffSupport def index # bla end # more actions here end However, the ''FancyStuffSupport'' is not reloaded, only the ''FooController'' itself. Can this behaviour be changed? I feel back
2007 Jan 20
0
Best way to force a respond_to format
I am playing around with the idea of adding to the HTTP_ACCEPT header method and trying to utilize WURFL for detecting mobile devices by USER_AGENT instead. I''m thinking I will set up some kind of before_filter in my controller, to intercept all requests and compare the USER_AGENT to some data source. If I detect that the USER_AGENT is a mobile device, then I''d like to force a
2012 Dec 11
2
Adding additional mount info to xsl stylesheet
The following patch attempts to make the source client user agent and the max listener client connection duration information available to (icecast 2.3.2) xsl stylesheets. Will there be any memory leak issues in the lower level functions like the acl, etc. when the source is disconnected, when servicing queries, or otherwise? BEGIN icecast-2.3.2-moremntinfo.patch diff --git src/source.c
2006 Feb 03
4
(BUG in svn/trunk?) - superclass mismatch for any subclass of ApplicationController
I track svn/trunk of Rails using svn:externals Some change to Rails committed in the last 1-2 days broke my subclass of ApplicationController The example, below, works with Rails 1.0, but in today''s svn, it dies with the following error: "superclass mismatch for class FooController" class ApplicationController < ActionController::Base end class FooController <
2006 Apr 10
6
detecting browser type?
I''m wondering how i can detect the browser type for the client. I know this is possible, but i cant seem to find how to do this, nor any example code for this. I would appreciate if someone could point me to some info or just give me an explanation. thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2023 Jul 07
1
Asterisk Release 20.3.1
The Asterisk Development Team would like to announce security release Asterisk 20.3.1. The release artifacts are available for immediate download at https://github.com/asterisk/asterisk/releases/tag/20.3.1 and https://downloads.asterisk.org/pub/telephony/asterisk The following security advisories were resolved in this release:
2023 Jul 07
1
Asterisk Release 20.3.1
The Asterisk Development Team would like to announce security release Asterisk 20.3.1. The release artifacts are available for immediate download at https://github.com/asterisk/asterisk/releases/tag/20.3.1 and https://downloads.asterisk.org/pub/telephony/asterisk The following security advisories were resolved in this release:
2007 Oct 07
1
How to store a Mechanize object in the database?
Hi, I am trying to save a Mechanize object in database (using a Rails Model). But the save operation throws a TypeError Considering that "agent" is an instance of a Rails Model and "user" is defined as a "text" type in the Model. irb(main):039:0> agent.user = WWW::Mechanize.new #<WWW::Mechanize:0xb71295f0 @follow_meta_refresh=false, @key=nil,