|
72 | 72 | describe "#add_class" do |
73 | 73 | it "should add the given class name to the element" do |
74 | 74 | foo = Element.find '#foo' |
75 | | - foo.has_class?('lemons').should be_false |
| 75 | + foo.has_class?('lemons').should eq(false) |
76 | 76 | foo.add_class 'lemons' |
77 | | - foo.has_class?('lemons').should be_true |
| 77 | + foo.has_class?('lemons').should eq(true) |
78 | 78 | end |
79 | 79 |
|
80 | 80 | it "should not duplicate class names on an element" do |
81 | 81 | bar = Element.find '#bar' |
82 | | - bar.has_class?('apples').should be_true |
| 82 | + bar.has_class?('apples').should eq(true) |
83 | 83 | bar.add_class 'apples' |
84 | 84 | bar.class_name.should == 'apples' |
85 | 85 | end |
|
93 | 93 |
|
94 | 94 | describe '#has_class?' do |
95 | 95 | it "should return true if the element has the given class" do |
96 | | - Element.find('#has-foo').has_class?("apples").should be_true |
97 | | - Element.find('#has-foo').has_class?("oranges").should be_false |
98 | | - Element.find('#has-bar').has_class?("lemons").should be_true |
| 96 | + Element.find('#has-foo').has_class?("apples").should eq(true) |
| 97 | + Element.find('#has-foo').has_class?("oranges").should eq(false) |
| 98 | + Element.find('#has-bar').has_class?("lemons").should eq(true) |
99 | 99 | end |
100 | 100 | end |
101 | 101 |
|
|
152 | 152 | describe '#toggle_class' do |
153 | 153 | it 'adds the given class name to the element if not already present' do |
154 | 154 | foo = Element.find('#foo') |
155 | | - foo.has_class?('oranges').should be_false |
| 155 | + foo.has_class?('oranges').should eq(false) |
156 | 156 | foo.toggle_class 'oranges' |
157 | | - foo.has_class?('oranges').should be_true |
| 157 | + foo.has_class?('oranges').should eq(true) |
158 | 158 | end |
159 | 159 |
|
160 | 160 | it 'removes the class if the element already has it' do |
161 | 161 | bar = Element.find('#bar') |
162 | | - bar.has_class?('apples').should be_true |
| 162 | + bar.has_class?('apples').should eq(true) |
163 | 163 | bar.toggle_class 'apples' |
164 | | - bar.has_class?('apples').should be_false |
| 164 | + bar.has_class?('apples').should eq(false) |
165 | 165 | end |
166 | 166 | end |
167 | 167 |
|
|
0 commit comments