similar to: Functional tests with actions that send files

Displaying 20 results from an estimated 3000 matches similar to: "Functional tests with actions that send files"

2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
Signed-off-by: Scott Seago <sseago at redhat.com> --- src/test/functional/host_controller_test.rb | 41 -------------------- .../functional/managed_node_configuration_test.rb | 14 ++++--- src/test/functional/nic_controller_test.rb | 8 ---- src/test/functional/permission_controller_test.rb | 15 ++++--- src/test/functional/quota_controller_test.rb | 2 +-
2008 Sep 25
0
Problem reading excel sheets
> Hi, > > I am new to ruby on rails.I am having problem reading excel files. I > tried using gem ''parseexcel'' but still the error is coming. > Could you please help me with the code and how to use this gem? Is > there any better way to read excel sheets. > > Snippet of Code: > > require ''rubygems'' > require_gem
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my products_controller: require File.dirname(__FILE__) + ''/../test_helper'' require ''products_controller'' # Re-raise errors caught by the controller. class ProductsController def rescue_action(e) raise e end end class ProductsControllerTest < Test::Unit::TestCase fixtures
2009 May 28
4
Read & name multiple excel sheets using RODBC
I'd like to be able to read multiple sheets from an excel workbook and use the sheet name to name the resulting dataframe using RODBC. at the moment i've figured out how to do it the long way (see below) but feel sure that there is a speedier & possibly automatic way to do it in R. i've tried to run a loop using sqlTables but it seemed to break the connection. unless i've
2006 Aug 04
2
Functional Testing Anomoly
I have a test method (below). def test_save_failed post( :edit, :record => StatusChanger.invalid_data_hash) assert_response :success assert_template ''edit'' assert assigns(:record) assert_equal false, assigns(:record).valid? end This particular method is part of a larger set of functional tests. If I run, $ ruby controller_test.rb -n
2006 Nov 04
0
Functional test issue for testing newbie
Hi there I''m having difficulty succesfully updating attributes via a post request in a functional test. Here''s some pastes: ###################################### # account_controller.rb def edit_details @user = User.find(self.current_user.id) return unless request.post? if @user.update_attributes(params[:user]) flash[:notice_good] = ''Your account details
2008 Aug 26
1
problem in reading the columns from an xls file
I am having a problem in reading the columns from an xls file. Following is the code: workbook = Spreadsheet::ParseExcel.parse(params[:dump][:file]) worksheet = workbook.worksheet(0) skip=0 worksheet.each(skip) { |row| puts row.at(0) } I am storing "Customer" in the first row first column. When I print, it is received as
2006 Apr 04
1
integration tests - 1.1
I?m using the new 1.1 integration test facility? I?m trying to write a test that sees if a controller redirects to the correct place and preserves the query string. Here?s the code: class LoginRedirectTest < ActionController::IntegrationTest def test_non_admin_auth request_uri = "/datafeed/event/report?blah=blah" get(request_uri) follow_redirect!
2006 Oct 21
6
test_create gets 200 instead of :success
Help! I have a new/create process that works fine in the actual app. But when I test I always get a failure in the test_create section. Here''s some controller code: def new end def create begin @borrower = Borrower.new(params[:borrower]) if @borrower.save flash[:notice] = ''Borrower '' + @borrower.FirstName + '' '' +
2006 Jul 06
6
Functional tsts
Hi all, I have created projects module in my application using scaffold, and it created me everything, and all the modules are working except the functional test. This is the error 1) Failure: test_create(ProjectsControllerTest) [test/functional/projects_controller_test.rb :55]: Expected response to be a <:redirect>, but was <200> 8 tests, 25 assertions, 1 failures, 0
2009 Apr 21
2
validates_uniqueness_of
hello all, i am new to RoR programming and am struck with the functional test whole checking for uniqeness of carriers. If it is not unique,the the bin shudn''t be created.Can someone help me in correcting my code. def test_create_failure_cycle_unique begin num_bins = Bin.count post :create, {:bin => { :carrier => carriers(:A), :cycle => cycles(:one), :name =>
2009 Apr 07
0
File created using Spreadsheet Excel can't read on linux
Hi All, Created xls file using spreadsheet Excel is not read on linux. I am creating an xls file are as follows workbook = Spreadsheet::Excel.new("Filepath") worksheet = workbook.add_worksheet("Sheet1") | | | workbook.close but when i am trying to download this it not get download. -- Posted via http://www.ruby-forum.com/.
2007 Jan 21
0
Functional Test Fails with before filter in application.rb
Hi There, I am trying to write my first tests for a role bassed authentication taken from Rails Recipies. Whenever I add: assert_redirected_to :action => ''login'' I get the following error: NoMethodError: undefined method `first'' for :user:Symbol /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/assertions/response_assertions.rb:72:in
2010 Jan 03
2
Problem with downloading a generated Excel sheet
Hello, I''m using the spreadsheet/excel gem to generate an excel sheet that I want user to be able to download it once it''s generated. Please take a look on the below code: @contacts=Contact.find(:all) if @contacts.size>0 file="#{Date.today}_Report.xls" workbook=Spreadsheet::Excel.new("#{RAILS_ROOT}/public/reports/#{file}")
2005 Dec 14
1
Problems with testing - error posting to other controller
Hi, I''m trying to test my ad_controller. In order to create an ad, the user has to be logged in, so I have written a login() that logs in a valid user and generates a session[:user_id], like: def login (login="bob", password="atest") post "user/login", :user => { :login => login, :password => password } assert_response 302 # redirect
2008 Apr 01
2
Functional Testing - page actions
Pretty simple question, I''ve tried to ajaxify some actions and the first one I did was a delete - def delete_job ..... render :update do |page| page.remove "job_#{id}" end .... end and in my functional test I call this function via post def test.... post :delete_job, :id => 1 assert_response :success ...... end after the assert_response, how do I test that the page
2006 Oct 13
6
If I stub do I have to mock as well?
Hi, I''m new to mocha and stubba but eager to learn. I have a rails functional test in which I would like to stub an instance method of particular class to always return true. I tried the following: def test_post_checkout Order.any_instance.stubs(:successful?).returns(true) post :checkout assert_response :redirect assert_equal "Checkout was successful.",
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
Commit bd1c5c9f4dcf38458099db8a0bf4659a07ef055d changed all the code to use Jansson instead of yajl. However it didn't change the OCaml API name (which was still Yajl). This commit changes the module to a neutral name ("JSON_parser") and moves it into common/mltools so it can be used by other tools. This leaves us in a slightly awkward situation of having two JSON-ish OCaml
2008 Feb 01
1
problems with link_to_remote and send_file
Hi everyone, I working on an app that at some point generates an xls report(charts, summary lines, etc) and sends it to the user. If i use link_to everything works fine; however when change to link_to_remote so i can make an ajax call it doesn;t seam to work ( i do not get the save/open dialog box) def exp_to_excel_2003 @filepath = "#{RAILS_ROOT}/public/files/Metrics Report.xls"
2008 Mar 11
0
Facebooker-talk Digest, Vol 5, Issue 12
Hi all, I wanted to test requests from internal facebook apps, so I''ve been mimicking FBML requests from facebook in my tests using the following: def test_can_facebook_internal_app_login fb_login_as :facebooker num_of_members = Member.count facebook_request :get, :home assert_response :success assert_equal num_of_members, Member.count