rails创建项目,部署,测试流程(rails5.0+ruby2.3.1)
rails new test_app --skip-test-unit 不生成默认的test,稍后用rspec
cd test_app
修改Gemfile(大部分为自动生成)
source 'https://ruby.taobao.org' -- 使用淘宝镜像,因为连接不了rubygem # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1' --rails版本
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
gem "slim-rails" --能够让erb转slim
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7' # Use Capistrano for deployment
# gem 'capistrano-rails', group: :development group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
gem 'rspec-rails', '3.5.1' -- 此处添加最新rspec
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end group :test do -- 添加capybara及其依赖gem,能够编写类英语交互语句
gem 'selenium-webdriver', '~> 2.53', '>= 2.53.4'
gem 'capybara', '2.8.0'
end group :production do
gem 'pg', '~> 0.18.4'
end group :development do --heroku部署用
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
bundle install
bundle install --without production
bundle update
bundle install
生成rspec测试模块
rails generate rspec:install
push至git上
git init
git add .
git commit -m "Initial commit"
git remote add origin url
git push -u origin master
设置rails,让其服务于静态资源文件
config/environments/production.rb
TestApp::Application.configure do
.
.
.
config.serve_static_assets = true
.
.
.
end
spec测试文件:
require 'rails_helper' RSpec.describe "StaticPages", :type => :feature do
describe "Home page" do
it "should have the content 'Help'" do
visit '/static_pages/home'
expect(page).to have_content('Sample App')
end
end describe "Help page" do
it "should have the content 'Help'" do
visit '/static_pages/help'
expect(page).to have_content('Help')
end
end
end
测试语句
bundle exec rspec spec/requests/static_pages_spec.rb
启动rails
rails s
rails创建项目,部署,测试流程(rails5.0+ruby2.3.1)的更多相关文章
- vue- Vue-Cli脚手架工具安装 -创建项目-页面开发流程-组件生命周期- -03
目录 Vue-Cli 项目环境搭建 与 python 基础环境对比 环境搭建 创建启动 vue 项目 命令创建项目(步骤小多) 启动 vue 项目(命令行方式) 启动 vue 项目(pycharm 方 ...
- JSP_运维_JSP项目部署到server(适合0经验新手)
实战:真正server端部署jsp项目经验总结与记录(完整过程从0到10适合对server端部署0经验新手) jsp+tomcat+mysql项目部署到真正server; servermysql安装; ...
- 迷你商城后台管理系统————stage3项目部署测试汇总
系统测试 在项目部署到云服务器之前,已通过本机启动springboot程序,访问localhost:8080,输入登陆的账户等一系列操作测试:功能测试.健壮性测试,系统已满足用户规定的需求. 系统部署 ...
- 迷你商城后台管理系统---------stage3项目部署测试汇总
系统测试 在项目部署到云服务器之前,已通过本机启动springboot程序,访问localhost:8080,输入登陆的账户等一系列操作测试:功能测试.健壮性测试,系统已满足用户规定的需求. 系统部署 ...
- Web项目后台测试流程
1. 本地下载项目源码 1. Git clone项目代码到本地(本地项目代码1)并fetch: 2. Switch到master分支: 3. Create测试分支(例如:test1)并勾选“Switc ...
- rails 创建项目、创建controller、model等
rails2之前创建新项目: rails3以及更高版本创建新项目:rails new webname 创建数据表model:rails g model user name:string sex:str ...
- web手工项目01-系统组织框架-测试流程-需求评审-测试计划与方案
回顾 SVN(定义,作用,使用操作) 软件缺陷(定义,表现形式,原因和根源,基本内容,跟踪流程) JIRA(基本介绍,使用者,工作流,问题,使用) 学习目标 掌握WAMP的环境搭建 掌握熟悉项目的步骤 ...
- web测试流程的总结及关注点
项目的测试流程大只包含的几个阶段:立项.需求评审.用例评审.测试执行.测试报告文档 一.立项后测试需要拿到的文档 1.需求说明书 2.原型图(及UI图) 3.接口文档 4.数据库字典(表的数量.缓存机 ...
- vue-cli 3.0 安装和创建项目流程
使用前我们先了解下3.0较2.0有哪些区别 一.3.0 新加入了 TypeScript 以及 PWA 的支持二.部分命令发生了变化: 1.下载安装 npm install -g vue@cli 2. ...
随机推荐
- 【C】漫谈C语言随机数
来说说C语言如何产生随机数. 有人会说这不简单?time() + srand() + rand() 3个函数不就OK了吗? 是的,不过,我们还是来看看原理比较好,也就是随机数是如何产生的. 这不无聊. ...
- JQuery源码之“对象的结构解析”
吃完午饭,觉得有点发困,想起了以后我们的产品可能要做到各种浏览器的兼容于是乎不得不清醒起来!我们的web项目多数是依赖于Jquery的.据了解,在Jquery的2.0版本以后对IE的低端版本浏览器不再 ...
- JS实现页面回到顶部效果
[代码] <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...
- An Implementation of Double-Array Trie
Contents What is Trie? What Does It Take to Implement a Trie? Tripple-Array Trie Double-Array Trie S ...
- EChars学习-2
上海的echars学习 <html> <head> <meta charset="utf-8"> <meta http-equiv=&qu ...
- C#中value是什么意思
value是c#中的“属性”例如c#某个类中有一个成员变量(字段),为了安全性,外部如果要访问它,必须通过“属性”来访问:private int _id;//这是一个成员变量,private表示是私有 ...
- 使用jQuery为表单添加回车事件
$(document).keypress(function(e){ if(e.which==13){ checkUserForm(); } });
- JavaScript: JavaScript的简介和入门代码演示
1.Javascript的发展历史介绍: javascript是指的实在网页上编写的编程语言,其主要是控制器html的动态显示效果.HTMl能带来的只是一些基本的页面的风格,而要展示的漂亮使用CSS, ...
- linux多个python版本下导致no request报错
解决办法: sudo apt-get install uwsgi uwsgi-core uwsgi-plugin-python sudo apt-get install uwsgi-plugin-py ...
- Xib的使用与File'Owner总结
Xib的使用与File'Owner总结 一.XIB的适用范围 xib(也叫Nib)与storyboard一样是用来描述界面的. storyboard描述的是比较大型的,大范围.适合描述界面跳转等. 二 ...