Test coverage back to 100%
commit
daef15642e
|
@ -1,3 +1,5 @@
|
|||
# Api::DevicesController is the RESTful endpoint for managing device related
|
||||
# settings. Consumed by the Angular SPA on the front end.
|
||||
class Api::DevicesController < ApplicationController
|
||||
respond_to :json
|
||||
before_action :authenticate_user!
|
||||
|
@ -10,9 +12,9 @@ class Api::DevicesController < ApplicationController
|
|||
end
|
||||
|
||||
# GET /api/devices/1
|
||||
def show
|
||||
raise 'Not implemented.'
|
||||
end
|
||||
# def show
|
||||
# raise 'Not implemented.'
|
||||
# end
|
||||
|
||||
# POST /api/devices
|
||||
def create
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
macaw
|
|
@ -0,0 +1,92 @@
|
|||
.fluid-span-1 {
|
||||
width: 7.4166666667%;
|
||||
}
|
||||
|
||||
.fluid-span-2 {
|
||||
width: 15.8333333333%;
|
||||
}
|
||||
|
||||
.fluid-span-3 {
|
||||
width: 24.25%;
|
||||
}
|
||||
|
||||
.fluid-span-4 {
|
||||
width: 32.6666666667%;
|
||||
}
|
||||
|
||||
.fluid-span-5 {
|
||||
width: 41.0833333333%;
|
||||
}
|
||||
|
||||
.fluid-span-6 {
|
||||
width: 49.5%;
|
||||
}
|
||||
|
||||
.fluid-span-7 {
|
||||
width: 57.9166666667%;
|
||||
}
|
||||
|
||||
.fluid-span-8 {
|
||||
width: 66.3333333333%;
|
||||
}
|
||||
|
||||
.fluid-span-9 {
|
||||
width: 74.75%;
|
||||
}
|
||||
|
||||
.fluid-span-10 {
|
||||
width: 83.1666666667%;
|
||||
}
|
||||
|
||||
.fluid-span-11 {
|
||||
width: 91.5833333333%;
|
||||
}
|
||||
|
||||
.fluid-span-12 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fluid-offset-1 {
|
||||
margin-left: 8.4166666667%;
|
||||
}
|
||||
|
||||
.fluid-offset-2 {
|
||||
margin-left: 16.8333333333%;
|
||||
}
|
||||
|
||||
.fluid-offset-3 {
|
||||
margin-left: 25.25%;
|
||||
}
|
||||
|
||||
.fluid-offset-4 {
|
||||
margin-left: 33.6666666667%;
|
||||
}
|
||||
|
||||
.fluid-offset-5 {
|
||||
margin-left: 42.0833333333%;
|
||||
}
|
||||
|
||||
.fluid-offset-6 {
|
||||
margin-left: 50.5%;
|
||||
}
|
||||
|
||||
.fluid-offset-7 {
|
||||
margin-left: 58.9166666667%;
|
||||
}
|
||||
|
||||
.fluid-offset-8 {
|
||||
margin-left: 67.3333333333%;
|
||||
}
|
||||
|
||||
.fluid-offset-9 {
|
||||
margin-left: 75.75%;
|
||||
}
|
||||
|
||||
.fluid-offset-10 {
|
||||
margin-left: 84.1666666667%;
|
||||
}
|
||||
|
||||
.fluid-offset-11 {
|
||||
margin-left: 92.5833333333%;
|
||||
}
|
||||
|
|
@ -0,0 +1,720 @@
|
|||
body {
|
||||
background-color: rgb(230, 230, 230);
|
||||
font: 300 0.875em/1.38 'Open Sans';
|
||||
color: rgb(0,0,0);
|
||||
}
|
||||
|
||||
.absolute-position-control .widget-content {
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 99.9999999999%;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.column-axis {
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 24.8711340206%;
|
||||
}
|
||||
|
||||
.column-current-position {
|
||||
float: left;
|
||||
width: 24.8711340206%;
|
||||
}
|
||||
|
||||
.column-home {
|
||||
float: left;
|
||||
width: 24.8711340206%;
|
||||
height: 181px;
|
||||
}
|
||||
|
||||
.column-new-position {
|
||||
float: left;
|
||||
width: 24.8711340206%;
|
||||
margin-left: 0.2577319587%;
|
||||
}
|
||||
|
||||
.current-position-x {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
font-size: 1em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(0,0,0);
|
||||
}
|
||||
|
||||
.current-position-y,
|
||||
.current-position-z {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
font-size: 1em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(0,0,0);
|
||||
}
|
||||
|
||||
.device-selector {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 16%;
|
||||
min-width: 200px;
|
||||
height: 45px;
|
||||
margin-left: 1%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
border-radius: 3px;
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: left;
|
||||
color: rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
.home-all {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 50.2590673575%;
|
||||
height: 30px;
|
||||
margin: 19px 0 0 24.8704663212%;
|
||||
border-radius: 3px;
|
||||
background-color: rgb(26, 26, 26);
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.home-x {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 50.2590673575%;
|
||||
height: 30px;
|
||||
margin-left: 24.8704663212%;
|
||||
border-radius: 3px;
|
||||
background-color: rgb(39, 107, 238);
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.home-y {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 50.2590673575%;
|
||||
height: 30px;
|
||||
margin: 19px 0 0 24.8704663212%;
|
||||
border-radius: 3px;
|
||||
background-color: rgb(245, 216, 92);
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(26, 26, 26);
|
||||
}
|
||||
|
||||
.home-z {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 50.2590673575%;
|
||||
height: 30px;
|
||||
margin: 19px 0 0 24.8704663212%;
|
||||
border-radius: 3px;
|
||||
background-color: rgb(135, 31, 208);
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.image {
|
||||
display: block;
|
||||
position: relative;
|
||||
float: left;
|
||||
z-index: 34;
|
||||
width: 466px;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.jog-x-n1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 23.1759656652%;
|
||||
z-index: 46;
|
||||
width: 6.8669527896%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-x-n10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 16.5236051502%;
|
||||
z-index: 45;
|
||||
width: 6.8669527896%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-x-n100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 2.7896995708%;
|
||||
z-index: 38;
|
||||
width: 13.7339055793%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-x-p1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 36.4806866952%;
|
||||
z-index: 47;
|
||||
width: 6.8669527896%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-x-p10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 43.5622317596%;
|
||||
z-index: 48;
|
||||
width: 6.8669527896%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-x-p100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 141px;
|
||||
left: 50.643776824%;
|
||||
z-index: 37;
|
||||
width: 13.7339055793%;
|
||||
height: 28px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-n1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 169px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 44;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-n10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 43;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-n100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 235px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 36;
|
||||
width: 6.0085836909%;
|
||||
height: 64px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-p1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 109px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 42;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-p10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 76px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 41;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-y-p100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: 30.2575107296%;
|
||||
z-index: 35;
|
||||
width: 6.0085836909%;
|
||||
height: 64px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-n1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 170px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 52;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-n10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 201px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 51;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-n100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 234px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 40;
|
||||
width: 6.0085836909%;
|
||||
height: 64px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-p1 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 109px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 50;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-p10 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 76px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 49;
|
||||
width: 6.0085836909%;
|
||||
height: 34px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.jog-z-p100 {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 73.3905579399%;
|
||||
z-index: 39;
|
||||
width: 6.0085836909%;
|
||||
height: 64px;
|
||||
border-radius: 3px;
|
||||
font: 400 1.143em/1.38 Helvetica;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.move {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
margin-top: 15px;
|
||||
border: 1px solid rgb(0, 0, 0);
|
||||
border-radius: 3px;
|
||||
background-color: rgb(26, 26, 26);
|
||||
font-size: 1.143em;
|
||||
font-weight: 400;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
.move-to-x {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
padding: 15px;
|
||||
border: 2px solid rgb(39, 107, 238);
|
||||
border-radius: 5px;
|
||||
font-size: 1em;
|
||||
font-weight: 400;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.move-to-y {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
margin-top: 15px;
|
||||
padding: 15px;
|
||||
border: 2px solid rgb(245, 216, 92);
|
||||
border-radius: 5px;
|
||||
font-size: 1em;
|
||||
font-weight: 400;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.move-to-z {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
margin-top: 15px;
|
||||
padding: 15px;
|
||||
border: 2px solid rgb(135, 31, 208);
|
||||
border-radius: 5px;
|
||||
font-size: 1em;
|
||||
font-weight: 400;
|
||||
line-height: 1.38;
|
||||
text-align: center;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.navigation-dashboard,
|
||||
.navigation-farm-designer,
|
||||
.navigation-help,
|
||||
.navigation-settings {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
height: 45px;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
border-radius: 3px;
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: left;
|
||||
color: rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
.navigation-manual-control {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
height: 45px;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
border-radius: 3px;
|
||||
font-size: 1.143em;
|
||||
font-weight: 600;
|
||||
line-height: 1.38;
|
||||
text-align: left;
|
||||
color: rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
.relative-position-control .widget-content {
|
||||
position: relative;
|
||||
width: 466px;
|
||||
margin: 57px auto 0;
|
||||
}
|
||||
|
||||
.user-settings {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
height: 45px;
|
||||
margin-right: 1%;
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
border-radius: 3px;
|
||||
font-size: 1.143em;
|
||||
line-height: 1.38;
|
||||
text-align: right;
|
||||
color: rgb(204, 204, 204);
|
||||
}
|
||||
|
||||
.widget {
|
||||
float: left;
|
||||
width: 48.5%;
|
||||
margin: 60px 0 0 1%;
|
||||
background-color: rgb(217, 217, 217);
|
||||
}
|
||||
|
||||
.relative-position-control .jog-x-n1,
|
||||
.relative-position-control .jog-x-n10,
|
||||
.relative-position-control .jog-x-n100,
|
||||
.relative-position-control .jog-x-p1,
|
||||
.relative-position-control .jog-x-p10,
|
||||
.relative-position-control .jog-x-p100,
|
||||
.relative-position-control .jog-y-n1,
|
||||
.relative-position-control .jog-y-n10,
|
||||
.relative-position-control .jog-y-n100,
|
||||
.relative-position-control .jog-y-p1,
|
||||
.relative-position-control .jog-y-p10,
|
||||
.relative-position-control .jog-y-p100,
|
||||
.relative-position-control .jog-z-n1,
|
||||
.relative-position-control .jog-z-n10,
|
||||
.relative-position-control .jog-z-n100,
|
||||
.relative-position-control .jog-z-p1,
|
||||
.relative-position-control .jog-z-p10,
|
||||
.relative-position-control .jog-z-p100,
|
||||
.widget .jog-x-n1,
|
||||
.widget .jog-x-n10,
|
||||
.widget .jog-x-n100,
|
||||
.widget .jog-x-p1,
|
||||
.widget .jog-x-p10,
|
||||
.widget .jog-x-p100,
|
||||
.widget .jog-y-n1,
|
||||
.widget .jog-y-n10,
|
||||
.widget .jog-y-n100,
|
||||
.widget .jog-y-p1,
|
||||
.widget .jog-y-p10,
|
||||
.widget .jog-y-p100,
|
||||
.widget .jog-z-n1,
|
||||
.widget .jog-z-n10,
|
||||
.widget .jog-z-n100,
|
||||
.widget .jog-z-p1,
|
||||
.widget .jog-z-p10,
|
||||
.widget .jog-z-p100,
|
||||
.widget-content .jog-x-n1,
|
||||
.widget-content .jog-x-n10,
|
||||
.widget-content .jog-x-n100,
|
||||
.widget-content .jog-x-p1,
|
||||
.widget-content .jog-x-p10,
|
||||
.widget-content .jog-x-p100,
|
||||
.widget-content .jog-y-n1,
|
||||
.widget-content .jog-y-n10,
|
||||
.widget-content .jog-y-n100,
|
||||
.widget-content .jog-y-p1,
|
||||
.widget-content .jog-y-p10,
|
||||
.widget-content .jog-y-p100,
|
||||
.widget-content .jog-z-n1,
|
||||
.widget-content .jog-z-n10,
|
||||
.widget-content .jog-z-n100,
|
||||
.widget-content .jog-z-p1,
|
||||
.widget-content .jog-z-p10,
|
||||
.widget-content .jog-z-p100 {
|
||||
font: !consolidated !consolidated !consolidated;
|
||||
}
|
||||
|
||||
.widget-content-titles {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 99.9999999999%;
|
||||
}
|
||||
|
||||
.widget-header {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 99.9999999999%;
|
||||
padding: 15px 45px 15px 15px;
|
||||
border-radius: 3px;
|
||||
font-size: 1.429em;
|
||||
line-height: 1.38;
|
||||
text-align: left;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
._container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 7;
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
background-color: rgb(26, 26, 26);
|
||||
}
|
||||
|
||||
._text {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
padding: 15px;
|
||||
line-height: 1.38;
|
||||
color: rgb(0,0,0);
|
||||
}
|
||||
|
||||
.column-axis ._text {
|
||||
width: 100%;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.widget-content-titles ._text {
|
||||
width: 24.9999999999%;
|
||||
font-size: 0.857em;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.column-axis ._text-6,
|
||||
.column-axis ._text-7 {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.widget-content-titles ._text-2,
|
||||
.widget-content-titles ._text-3,
|
||||
.widget-content-titles ._text-4 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media(max-width: 1200px) {
|
||||
.relative-position-control {
|
||||
clear: both;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.relative-position-control .widget-content {
|
||||
float: left;
|
||||
clear: both;
|
||||
margin-top: 0;
|
||||
margin-right: 0;
|
||||
margin-left: 20.1282051282%;
|
||||
}
|
||||
|
||||
.widget {
|
||||
width: 65%;
|
||||
margin-left: 17.5%;
|
||||
}
|
||||
|
||||
.widget-content .image {
|
||||
position: relative;
|
||||
z-index: 34;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
._container .user-settings-1 {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.widget-content-titles ._text-4 {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 800px) {
|
||||
body {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
.relative-position-control .widget-content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.widget {
|
||||
width: 98%;
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
.widget-content .image {
|
||||
position: relative;
|
||||
z-index: 34;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
._container .navigation-dashboard-1 {
|
||||
clear: both;
|
||||
margin-top: -45px;
|
||||
margin-left: 17%;
|
||||
}
|
||||
|
||||
._container .navigation-farm-designer-1 {
|
||||
margin-top: -45px;
|
||||
margin-left: 30.5%;
|
||||
}
|
||||
|
||||
._container .navigation-help-1 {
|
||||
margin-top: -45px;
|
||||
margin-left: 75.125%;
|
||||
}
|
||||
|
||||
._container .navigation-manual-control-1 {
|
||||
margin-top: -45px;
|
||||
margin-left: 47.125%;
|
||||
}
|
||||
|
||||
._container .navigation-settings-1 {
|
||||
margin-top: -45px;
|
||||
margin-left: 64.375%;
|
||||
}
|
||||
|
||||
._container .user-settings-1 {
|
||||
clear: both;
|
||||
margin-right: -0.5%;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,491 @@
|
|||
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
|
||||
|
||||
/* ==========================================================================
|
||||
HTML5 display definitions
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Correct `block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
article,
|
||||
aside,
|
||||
details,
|
||||
figcaption,
|
||||
figure,
|
||||
footer,
|
||||
header,
|
||||
hgroup,
|
||||
main,
|
||||
nav,
|
||||
section,
|
||||
summary {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct `inline-block` display not defined in IE 8/9.
|
||||
*/
|
||||
|
||||
audio,
|
||||
canvas,
|
||||
video {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent modern browsers from displaying `audio` without controls.
|
||||
* Remove excess height in iOS 5 devices.
|
||||
*/
|
||||
|
||||
audio:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Set default font family to sans-serif.
|
||||
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||
* user zoom.
|
||||
* 3. Ensure that the HTML is always 100% height. This fixed body height issues in Chrome for example.
|
||||
*/
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove default margin.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Links
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address `outline` inconsistency between Chrome and other browsers.
|
||||
*/
|
||||
|
||||
a:focus {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability when focused and also mouse hovered in all browsers.
|
||||
*/
|
||||
|
||||
a:active,
|
||||
a:hover {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Typography
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address variable `h1` font-size and margin within `section` and `article`
|
||||
* contexts in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: 1px dotted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address differences between Firefox and other browsers.
|
||||
*/
|
||||
|
||||
hr {
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address styling not present in IE 8/9.
|
||||
*/
|
||||
|
||||
mark {
|
||||
background: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct font family set oddly in Safari 5 and Chrome.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
pre,
|
||||
samp {
|
||||
font-family: monospace, serif;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/**
|
||||
* Improve readability of pre-formatted text in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set consistent quote types.
|
||||
*/
|
||||
|
||||
q {
|
||||
quotes: "\201C" "\201D" "\2018" "\2019";
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent and variable font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove border when inside `a` element in IE 8/9.
|
||||
*/
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct overflow displayed oddly in IE 9.
|
||||
*/
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Figures
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Address margin not present in IE 8/9 and Safari 5.
|
||||
*/
|
||||
|
||||
figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Define consistent border, margin, and padding.
|
||||
*/
|
||||
fieldset {
|
||||
margin: 0 2px;
|
||||
padding: 0.35em 0.625em 0.75em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct `color` not being inherited in IE 8/9.
|
||||
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||
*/
|
||||
|
||||
legend {
|
||||
border: 0; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct font family not being inherited in all browsers.
|
||||
* 2. Correct font size not being inherited in all browsers.
|
||||
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 2 */
|
||||
font-weight: inherit; /* 1 */
|
||||
margin: 0; /* 3 */
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default button background color that browsers set
|
||||
*/
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||
* the UA stylesheet.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||
* All other form control elements do not inherit `text-transform` values.
|
||||
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
|
||||
* Correct `select` style inheritance in Firefox 4+ and Opera.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure selects don't get the default browser styles.
|
||||
*/
|
||||
select {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||
* and `video` controls.
|
||||
* 2. Correct inability to style clickable `input` types in iOS.
|
||||
* 3. Improve usability and consistency of cursor style between image-type
|
||||
* `input` and others.
|
||||
*/
|
||||
|
||||
button,
|
||||
html input[type="button"], /* 1 */
|
||||
input[type="reset"],
|
||||
input[type="submit"] {
|
||||
-webkit-appearance: button; /* 2 */
|
||||
cursor: pointer; /* 3 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-set default cursor for disabled elements.
|
||||
*/
|
||||
|
||||
button[disabled],
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address box sizing set to `content-box` in IE 8/9.
|
||||
* 2. Remove excess padding in IE 8/9.
|
||||
*/
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
|
||||
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
|
||||
* (include `-moz` to future-proof).
|
||||
*/
|
||||
|
||||
input[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box; /* 2 */
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and search cancel button in Safari 5 and Chrome
|
||||
* on OS X.
|
||||
*/
|
||||
|
||||
input[type="search"]::-webkit-search-cancel-button,
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove inner padding and border in Firefox 4+.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
input::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove default vertical scrollbar in IE 8/9.
|
||||
* 2. Improve readability and alignment in all browsers.
|
||||
* 3. Disable resizing by default.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto; /* 1 */
|
||||
vertical-align: top; /* 2 */
|
||||
resize: none; /* 3 */
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Tables
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove most spacing between table cells.
|
||||
*/
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-weight: inherit;
|
||||
font-style: inherit;
|
||||
font-size: 100%;
|
||||
font-family: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
/* remember to define focus styles! */
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
ol, ul, li {
|
||||
list-style: none;
|
||||
}
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
caption, th, td {
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: "";
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: "" "";
|
||||
}
|
||||
a,
|
||||
a:hover,
|
||||
a:visited {
|
||||
text-decoration: none;
|
||||
}
|
||||
button,
|
||||
input,
|
||||
fieldset,
|
||||
textarea,
|
||||
select {
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
border: none;
|
||||
}
|
||||
img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.clearfix:before, .clearfix:after { content: ""; display: table; }
|
||||
.clearfix:after { clear: both; }
|
||||
.clearfix { *zoom: 1; }
|
||||
|
||||
* {
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 23 KiB |
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,80 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1.0">
|
||||
<title>manual-control</title>
|
||||
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,800,600" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="css/standardize.css">
|
||||
<link rel="stylesheet" href="css/manual-control-grid.css">
|
||||
<link rel="stylesheet" href="css/manual-control.css">
|
||||
</head>
|
||||
<body class="body manual-control clearfix">
|
||||
<header class="_container clearfix">
|
||||
<button class="device-selector">Device Name </button>
|
||||
<button class="navigation-dashboard navigation-dashboard-1">Dashboard </button>
|
||||
<button class="navigation-farm-designer navigation-farm-designer-1">Farm Designer </button>
|
||||
<button class="navigation-manual-control navigation-manual-control-1">Manual Control </button>
|
||||
<button class="navigation-settings navigation-settings-1">Settings </button>
|
||||
<button class="navigation-help navigation-help-1">Help </button>
|
||||
<button class="user-settings user-settings-1">Welcome, Rory!</button>
|
||||
</header>
|
||||
<div class="widget absolute-position-control clearfix">
|
||||
<button class="widget-header h2">Absolute Position Control</button>
|
||||
<div class="widget-content clearfix">
|
||||
<div class="widget-content-titles h3 clearfix">
|
||||
<p class="_text">Axis</p>
|
||||
<p class="_text _text-2">Current Position (m)</p>
|
||||
<p class="_text _text-3">Enter New Position (m)</p>
|
||||
<p class="_text _text-4">Home</p>
|
||||
</div>
|
||||
<div class="column-axis clearfix">
|
||||
<p class="_text">Gantry (X)</p>
|
||||
<p class="_text _text-6">Cross-Slide (Y)</p>
|
||||
<p class="_text _text-7">Tool Mount (Z)</p>
|
||||
</div>
|
||||
<div class="column-current-position clearfix">
|
||||
<p class="current-position-x">10.345</p>
|
||||
<p class="current-position-y">10.345</p>
|
||||
<p class="current-position-z">10.345</p>
|
||||
</div>
|
||||
<div class="column-new-position clearfix">
|
||||
<input class="move-to-x" type="number">
|
||||
<input class="move-to-y" name="Enter an X coordinate in meters" type="number">
|
||||
<input class="move-to-z" name="Enter an X coordinate in meters" type="number">
|
||||
<button class="move">Move</button>
|
||||
</div>
|
||||
<div class="column-home clearfix">
|
||||
<button class="button home-x">X</button>
|
||||
<button class="button home-y">Y</button>
|
||||
<button class="button home-z">X</button>
|
||||
<button class="button home-all">All</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget relative-position-control clearfix">
|
||||
<button class="widget-header h2">Relative Position Control</button>
|
||||
<div class="widget-content clearfix">
|
||||
<img class="image" src="images/Jog Control Pad.svg">
|
||||
<button class="jog-z-n1"> </button>
|
||||
<button class="jog-z-n10"> </button>
|
||||
<button class="jog-z-p1"> </button>
|
||||
<button class="jog-z-p10"> </button>
|
||||
<button class="jog-x-p10"> </button>
|
||||
<button class="jog-x-p1"> </button>
|
||||
<button class="jog-x-n1"> </button>
|
||||
<button class="jog-x-n10"> </button>
|
||||
<button class="jog-y-n1"> </button>
|
||||
<button class="jog-y-n10"> </button>
|
||||
<button class="jog-y-p1"> </button>
|
||||
<button class="jog-y-p10"> </button>
|
||||
<button class="jog-z-n100"> </button>
|
||||
<button class="jog-z-p100"> </button>
|
||||
<button class="jog-x-n100"> </button>
|
||||
<button class="jog-x-p100"> </button>
|
||||
<button class="jog-y-n100"> </button>
|
||||
<button class="jog-y-p100"> </button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,7 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# Api::DevicesController is the RESTful endpoint for managing device related
|
||||
# settings. Consumed by the Angular SPA on the front end.
|
||||
describe Api::DevicesController do
|
||||
|
||||
include Devise::TestHelpers
|
||||
|
@ -10,12 +8,13 @@ describe Api::DevicesController do
|
|||
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'returns all the users devices, as JSON' do
|
||||
it 'creates a new device for a user' do
|
||||
sign_in user
|
||||
params = {user_id: user.id, name: 'Frank', uuid: '123', token: '321'}
|
||||
params = {user_id: user.id, name: 'Frank', uuid: '123', token: '321'}
|
||||
post :create, params
|
||||
device = user.devices.first
|
||||
expect(response.body).to include(device.id)
|
||||
resp = JSON.parse(response.body)
|
||||
new_device = Device.find(resp['_id'])
|
||||
expect(new_device.user).to eq(user)
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Api::DevicesController do
|
||||
|
||||
include Devise::TestHelpers
|
||||
|
||||
describe '#destroy' do
|
||||
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'destroys a Device' do
|
||||
sign_in user
|
||||
delete :destroy, id: user.devices.first.id, fromat: :json
|
||||
user.reload
|
||||
expect(user.devices.count).to eq(0)
|
||||
expect(response.status).to eq(204)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,24 +1,19 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# Api::DevicesController is the RESTful endpoint for managing device related
|
||||
# settings. Consumed by the Angular SPA on the front end.
|
||||
describe Api::DevicesController do
|
||||
|
||||
include Devise::TestHelpers
|
||||
|
||||
describe '#index' do
|
||||
|
||||
let(:user) do
|
||||
user = FactoryGirl.create(:user)
|
||||
user.devices << FactoryGirl.create(:device)
|
||||
user
|
||||
end
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'returns all the users devices, as JSON' do
|
||||
sign_in user
|
||||
get :index
|
||||
get :index, format: :json
|
||||
device = user.devices.first
|
||||
expect(response.body).to include(device._id)
|
||||
id = JSON.parse(response.body).first["_id"]
|
||||
expect(Device.find(id)).to eq(device)
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Api::DevicesController do
|
||||
|
||||
include Devise::TestHelpers
|
||||
|
||||
describe '#show' do
|
||||
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'shows a single Device' do
|
||||
pending
|
||||
sign_in user
|
||||
get :show, {id: user.devices.first.id}
|
||||
shown = JSON.parse response.body
|
||||
expect(shown).to eq(user.devices.first.to_json)
|
||||
expect(response.status).to eq(204)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,24 @@
|
|||
require 'spec_helper'
|
||||
|
||||
# Api::DevicesController is the RESTful endpoint for managing device related
|
||||
# settings. Consumed by the Angular SPA on the front end.
|
||||
describe Api::DevicesController do
|
||||
|
||||
include Devise::TestHelpers
|
||||
|
||||
describe '#update' do
|
||||
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
|
||||
it 'updates a Device' do
|
||||
sign_in user
|
||||
fake_name = Faker::Name.name
|
||||
put :update, {id: user.devices.first.id, name: fake_name}, format: :json
|
||||
# put path, params, options
|
||||
user.reload
|
||||
device = user.devices.first
|
||||
expect(device.name).to eq(fake_name)
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -5,5 +5,8 @@ FactoryGirl.define do
|
|||
name Faker::Name.name
|
||||
email Faker::Internet.email
|
||||
password Faker::Internet.password(8)
|
||||
after(:create) do |user|
|
||||
FactoryGirl.create(:device, user: user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
require 'simplecov'
|
||||
#Ignore anything with the word 'spec' in it. No need to test your tests.
|
||||
SimpleCov.start{ add_filter '/spec/' }
|
||||
SimpleCov.start do
|
||||
add_filter '/spec/'
|
||||
add_filter 'config/initializers'
|
||||
end
|
||||
require 'pry'
|
||||
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
||||
ENV["RAILS_ENV"] ||= 'test'
|
||||
|
|
Loading…
Reference in New Issue