search for: have_cont

Displaying 7 results from an estimated 7 matches for "have_cont".

Did you mean: have_const
2012 Jun 14
3
response.should have_content("1 movie") does not seem to work for me
...to near the end of The RSpec Book, but now I''m having some troubles. I''m trying to get the last few Cucumber steps to work, which are: Then /^Caddyshack should be in the Comedy genre$/ do visit genres_path click_link "Comedy" save_and_open_page response.should have_content("1 movie") response.should have_content("Caddyshack") end So far everything''s working, but the have_content("1 movie") doesn''t, although I have hard-coded the string into the view, and when displaying what Webrat sees using save_and_open_page, t...
2011 Jun 29
6
RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)
...@message %> ======== In spec/views/user_sessions/new.html.erb_spec.rb: require ''spec_helper'' describe "user_sessions/new.html.erb" do context "displays the admin login form" do it "shows the title" do render rendered.should have_content("Admin Login") # this is fine rendered.should have_content("Hello.") # I added this just to test something simple, but it didn''t work end it "shows the form" it "shows the button" end end ======== If I do "ra...
2013 Nov 22
2
Cancan Rspec load_and_authorize_resource
...load_and_authorize_resource except: :create end ads_controller_spec.rb: require ''spec_helper'' describe AdsController do render_views describe ''Guest role'' do it "should not display link to new ad" do visit ads_path page.should_not have_content(''New'') end end end Gems: rails (4.0.0),rake (10.1.0),cancan (1.6.10), * rspec-core (2.14.5) * rspec-expectations (2.14.3) * rspec-mocks (2.14.3) * rspec-rails (2.14.0) Can`t find any answer in google or github... Will be thankfully for any help. Attachments: ht...
2012 Jun 14
1
Cucumber/RSpec ::: Capybara? Webrat What am I using??
...e nice but I had some other strange behavior now. In fact, I had an error message that the contain() was not found. After some searching on Google (and having seen the term capybara before somewhere in my error messages), somebody pointed out that when using capybara, contain() would not exist, but have_content(). So I tried it with have_content(), and it worked! I’m a bit confused now – what exactly am I using? Capybara or Webrat?? I thought I use Webrat, and Capybara is never mentioned in the RSpec book. So why/where did Capybara sneak in?? Was Webrat maybe replaced in the never Rails version I’m us...
2011 Aug 28
3
rspec-rails render_views doesn't render layouts? / how to check flash isn't rendered
...render_views specify "flash notices are not rendered" do flash[:notice] = "flash boo" flash[:error] = "flash boo" flash[:alert] = "flash boo" get :show, :page => ''privacy_policy'' response.body.should have_content(''flash boo'') end end class StaticPagesController < ApplicationController layout ''master'' def show response.headers[''Cache-Control''] = "public, max-age=#{6.hours}" render "static_pages/#{params[:page]}&quo...
2012 Feb 16
0
Upgrading from 3.2.0 to 3.2.1: Wrong Number of Arguments
Simple spec passes in 3.2.0: it "destroys an album" do 3.times { Factory(:album, photo_library: @photo_library) } visit photo_library_path(@photo_library) find("h3").click_link ''Delete'' find("#notice").should have_content("Album deleted successfully") Album.count.should eq 2 end But fails in 3.2.1 with: 1) Albums destroys an album Failure/Error: login_admin ArgumentError: wrong number of arguments (0 for 1) # ./app/controllers/sessions_controller.rb:8:in `create''...
2012 Jul 17
24
Static Pages from Railcast
Hi everyone, I need several pages to be static but also modify when requested. I try following the railcast from Ryan at http://railscasts.com/episodes/117-semi-static-pages?view=comments Here what I have done!! rails g scaffold Pages name:string permanentlink:string title:string author:string access_level:string is_published:boolean meta_description:string meta_keyword:string