post "/" do begin files = params[:files].map {|file| file[:tempfile] } rescue halt 401, "401: invalid parameters, maybe\n" end begin image = Magick::ImageList.new(*files.map(&:path)) rescue halt 405, "405: invalid image files, maybe\n" end content_type "image/gif" tempfile = Pathname.new(Tempfile.new(["", ".gif"])) image.write(tempfile) tempfile.read end end
end after(:all) do @rec.generate! end it "shows one message and toggles by the button", js: true do visit '/sample.html' @rec.add(page) page.should have_css(".contents div", count: 1) page.should have_css ".en" click_button "Change" @rec.add(page) # ... end end