Skip to content

Commit

Permalink
Added test for attributes with dashes, and ability to set multiple at…
Browse files Browse the repository at this point in the history
…tributes in one call
  • Loading branch information
Stuk committed Nov 23, 2010
1 parent ed6481e commit 2292649
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
@element.attr(:class).should == 'descartes'
end

it 'can access attributes with dashes' do
@leaf.attr(:"data-fixture").should == 'leaf'
end

it 'is nil when the attribute does not exist' do
@element.attr(:hoobaflooba).should == nil
end
Expand All @@ -63,6 +67,12 @@
@element.attr(:id => 'value')
@element.attr(:id).should == 'value'
end

it 'sets multiple attributes when passed values' do
@element.attr(:id => 'one', :class => 'two')
@element.attr(:id).should == 'one'
@element.attr(:class).should == 'two'
end
end

# text
Expand Down Expand Up @@ -217,7 +227,7 @@
# -------

# focus!
describe '#focus' do
describe '#focus!' do
before :each do
browser.url = fixture('forms_with_input_elements.html')
end
Expand All @@ -236,7 +246,7 @@
end

# click!([x, y]) , x,y relative to element top left
describe '#click' do
describe '#click!' do
it 'follows links' do
window.find_elements_by_id('link_3').first.click!
window.url.should match /forms_with_input_elements\.html$/
Expand Down

0 comments on commit 2292649

Please sign in to comment.