require 'spec_helper'
describe WorldFlags::ViewHelper do
include ControllerTestHelpers,
WorldFlags::ViewHelper
it "should be empty, with an empty block" do
output = flags_list do
end
output.should == "
"
end
it "should work with alias :flag_list" do
output = flag_list do
end
output.should == ""
end
it "should set size to 16 or 32" do
lambda do flags_list(8) { }
end.should raise_error
end
it "should set size to 16 or 32" do
output = flags_list 32 do
end
output.should == ""
end
it "should list flags using Hash arg" do
output = flags_list 32 do
flags :ar => 'Argentina', :gb => 'England', :dk => 'Denmark'
end
output.should == ""
end
it "should list flags using Array" do
output = flags_list 32 do
flags [:ar, :gb]
end
output.should == ""
end
it "should list flags" do
output = flag_title :ar, 'Argentina'
output.should == " "
end
it "should list flags" do
output = flags_list 32 do
flags_title :ar => 'Argentina'
end
output.should == ""
end
it "should list flags combined" do
output = flags_list 32 do
[flags(:ar => 'Argentina', :gb => 'England'), flag(:br, 'Brazil')].join.html_safe
end
output.should == ""
end
end