title: Rspec/capybara - test presence of a class OR another class
body: <p>In my ruby on Rails 4.2 app, on a page I have a conditional back end rule that translates into the page front end in a change in class</p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;i class='&lt;% if x=true %&gt;glyphicon glyphicon-thumbs-down&lt;% else&gt; glyphicon glyphicon-thumbs-up &gt;&lt;% end %&gt;' &lt;/i&gt;
         this is the message.
  &lt;/div&gt;
  </code></pre>
  
  <p>How to check presence with rspec 3/capybara that the page contains the class glyphicon-thumbs-down OR the class glyphicon-thumbs-up ?</p>
  
  <p>I tried the code below but it fails:</p>
  
  <pre><code>it "should sheck one of the 2 classes presence" do
    expect(page).to have_css '.glyphicon-thumbs-down' || expect(page).to have_css '.glyphicon-thumbs-up'
  end
  </code></pre>
  
  <p>I am getting the following error message:</p>
  
  <pre><code>syntax error, unexpected tIDENTIFIER, expecting keyword_end (SyntaxError)
  </code></pre>