Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
2d068d29
Commit
2d068d29
authored
Mar 13, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec devise macros
parent
083a28fd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
25 deletions
+33
-25
app/views/flow/show.html.slim
+6
-6
spec/controllers/flow_controller_spec.rb
+1
-7
spec/controllers/search_controller_spec.rb
+1
-0
spec/controllers/stock_controller_spec.rb
+10
-9
spec/spec_helper.rb
+3
-0
spec/support/controller_macros.rb
+9
-0
spec/support/devise.rb
+3
-3
No files found.
app/views/flow/show.html.slim
View file @
2d068d29
...
...
@@ -11,12 +11,12 @@
=
render
partial:
'posts/large_item'
,
locals:
{
post:
_post
}
.col-xs-4
.panel.panel-default
.panel-heading
h2
.panel-title
この1週間で閲覧の多かった投稿(調整中)
.panel-body.list-group
-
Post
.
limit
(
5
).
each
do
|
_post
|
=
render
partial:
'posts/small_item'
,
locals:
{
post:
_post
}
/
.panel.panel-default
/
.panel-heading
/
h2.panel-title この1週間で閲覧の多かった投稿(調整中)
/
.panel-body.list-group
/
- Post.limit(5).each do |_post|
/
= render partial: 'posts/small_item', locals: { post: _post }
.panel.panel-default
.panel-heading
...
...
spec/controllers/flow_controller_spec.rb
View file @
2d068d29
...
...
@@ -2,16 +2,10 @@ require 'spec_helper'
describe
FlowController
do
before
:each
do
@post
=
create
(
:post
)
end
describe
"GET 'show'"
do
login_user
it
"returns http success"
do
get
'show'
puts
'+++++++++++++++++++++++++++++'
p
response
.
body
puts
'+++++++++++++++++++++++++++++'
response
.
should
be_success
end
end
...
...
spec/controllers/search_controller_spec.rb
View file @
2d068d29
...
...
@@ -3,6 +3,7 @@ require 'spec_helper'
describe
SearchController
do
describe
"GET 'show'"
do
login_user
it
"returns http success"
do
get
'show'
response
.
should
be_success
...
...
spec/controllers/stock_controller_spec.rb
View file @
2d068d29
#
require 'spec_helper'
require
'spec_helper'
#
describe StockController do
describe
StockController
do
# describe "GET 'show'" do
# it "returns http success" do
# get 'show'
# response.should be_success
# end
# end
describe
"GET 'show'"
do
login_user
it
"returns http success"
do
get
'show'
response
.
should
be_success
end
end
#
end
end
spec/spec_helper.rb
View file @
2d068d29
...
...
@@ -94,6 +94,9 @@ RSpec.configure do |config|
DatabaseRewinder
.
clean
end
config
.
include
Devise
::
TestHelpers
,
:type
=>
:controller
config
.
extend
ControllerMacros
,
:type
=>
:controller
# Capybara.app_host = "http://127.0.0.1/"
register_poltergeist
(
config
)
...
...
spec/support/controller_macros.rb
0 → 100644
View file @
2d068d29
module
ControllerMacros
def
login_user
before
(
:each
)
do
controller
.
stub
(
:authenticate_user!
).
and_return
true
@request
.
env
[
"devise.mapping"
]
=
Devise
.
mappings
[
:user
]
sign_in
FactoryGirl
.
create
(
:alice
)
end
end
end
spec/support/devise.rb
View file @
2d068d29
RSpec
.
configure
do
|
config
|
config
.
include
Devise
::
TestHelpers
,
type: :controller
end
#
RSpec.configure do |config|
#
config.include Devise::TestHelpers, type: :controller
#
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment