spec/controllers/card_controller_spec.rb in wagn-1.19.6 vs spec/controllers/card_controller_spec.rb in wagn-1.20.0

- old
+ new

@@ -7,25 +7,25 @@ describe "- route generation" do def card_route_to opts={} route_to opts.merge(controller: "card") end - it "should recognize type" do + it "recognizes type" do # all_routes = Rails.application.routes.routes # require 'rails/application/route_inspector' # warn "rountes#{ENV['CONTROLLER']}:\n" + Rails::Application::RouteInspector.new.format(all_routes, ENV['CONTROLLER'])* "\n" expect(get: "/new/Phrase") .to card_route_to(action: "read", type: "Phrase", view: "new") end - it "should recognize .rss on /recent" do + it "recognizes .rss on /recent" do expect(get: "/recent.rss") .to card_route_to(action: "read", id: ":recent", format: "rss") end - it "should handle RESTful posts" do + it "handles RESTful posts" do expect(put: "/mycard").to card_route_to(action: "update", id: "mycard") expect(put: "/").to card_route_to(action: "update") end it "handle asset requests" do @@ -33,21 +33,21 @@ .to card_route_to(action: "asset", id: "application", format: "js") end ["/wagn", ""].each do |prefix| describe "routes prefixed with '#{prefix}'" do - it "should recognize .rss format" do + it "recognizes .rss format" do expect(get: "#{prefix}/*recent.rss") .to card_route_to(action: "read", id: "*recent", format: "rss") end - it "should recognize .xml format" do + it "recognizes .xml format" do expect(get: "#{prefix}/*recent.xml") .to card_route_to(action: "read", id: "*recent", format: "xml") end - it "should accept cards without dots" do + it "accepts cards without dots" do expect(get: "#{prefix}/random") .to card_route_to(action: "read", id: "random") end end end @@ -205,11 +205,11 @@ context "view = new" do before do login_as "joe_user" end - it "should work on index" do + it "works on index" do get :read, view: "new" expect(assigns["card"].name).to eq("") assert_response :success, "response should succeed" assert_equal Card::BasicID, assigns["card"].type_id, "@card type should == Basic" @@ -239,11 +239,11 @@ login_as :anonymous get :read, type: "Fruit", view: "new" assert_response :success end - it "should use card params name over id in new cards" do + it "uses card params name over id in new cards" do get :read, id: "my_life", card: { name: "My LIFE" }, view: "new" expect(assigns["card"].name).to eq("My LIFE") end end @@ -274,13 +274,13 @@ end end it "handles image with no read permission" do get :read, id: "mao2" - assert_response 403, "should deny html card view" + assert_response 403, "denies html card view" get :read, id: "mao2", format: "jpg" - assert_response 403, "should deny simple file view" + assert_response 403, "denies simple file view" end it "handles image with read permission" do login_as "joe_admin" get :read, id: "mao2" @@ -371,10 +371,10 @@ assert_redirected_to "/" assert_nil Card[t1.name] end end - it "should comment" do + it "comments" do Card::Auth.as_bot do Card.create name: "basicname+*self+*comment", content: "[[Anyone Signed In]]" end post :update, id: "basicname",