Given that I assume that rails helper image_tag works as intended, I
want to mock out call to this method in my helper.
spec/helpers/some_helper_spec.rb:
require 'spec_helper'
describe SomeHelper do
it 'allows stub tags' do
helper.should_receive(:image_tag).with(2).and_return(3)
Given that I assume that rails helper image_tag works as intended, I
want to mock out call to this method in my helper.
spec/helpers/some_helper_spec.rb:
require 'spec_helper'
describe SomeHelper do
it 'allows stub tags' do
helper.should_receive(:image_tag).with(2).and_return(3)
You could create some function (say window.GiveMeUrlForAjax) that
returns uri for ajax request, your test could then easily overwrite
that function before triggering event to perform ajax. Also you might
consider creating a function that returns data (in production it would
take url from "GiveMeUrl
Misunderstood examples.
Array1.collect{|s| s.split ('/').last}.should == array2 seems closer to
your intent.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
(Array1 - array2).should be_blank maybe?
On 28 Feb 2013 07:42, "Mattias A." wrote:
> Hi,
>
> I have array1 that contains several web address. Array2 contains the
> expected endings of array1 values. How can I control that arrays2 values
> is in array1?
>
> I have tried array1.should include array
else # for other formats condensed output
"return JSON:\n#{expected}"
end
end
end
I plan to use this running two formatters at same time -f doc and -f
html at same time to produce pretty HTML file, and relatively
condensed doc in console.
Big th