$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
import axios from 'axios'; | |
class Service { | |
constructor() { | |
let service = axios.create({ | |
headers: {csrf: 'token'} | |
}); | |
service.interceptors.response.use(this.handleSuccess, this.handleError); | |
this.service = service; | |
} |
yum install -y libpng | |
yum install -y libjpeg | |
yum install -y openssl | |
yum install -y icu | |
yum install -y libX11 | |
yum install -y libXext | |
yum install -y libXrender | |
yum install -y xorg-x11-fonts-Type1 | |
yum install -y xorg-x11-fonts-75dpi |
import Service from 'path/to/service'; | |
import 'jasmine-ajax' | |
describe('Service', () => { | |
let request, promise; | |
let instance = Service; | |
let payload = {foo:'bar'}; | |
let path = '/path'; | |
let callback = jasmine.createSpy('callback'); |
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
import React from 'react'; | |
import TestUtils from 'react/lib/ReactTestUtils'; | |
import Todo from './Todo'; | |
describe('Todo', () => { | |
let instance, li; | |
let Wrapper = React.createClass({ | |
render: function() { | |
return this.props.children; | |
} |
Your Class:
class YourClass < ActiveRecord::Base
attr_accessor :some_date
columns_hash["some_date"] = ActiveRecord::ConnectionAdapters::Column.new("some_date", nil, "date")
end
Your View:
<%= form_for :your_class do |f| %>
describe('saveResource', () => { | |
let resource = { id: 5, name: 'foo' }; | |
describe('when the response is a 200', () => { | |
let dispatch = jasmine.createSpy('dispatch'); | |
beforeEach(() => { | |
spyOn(Service, 'post').and.callFake(function(url, payload, callback) { | |
callback(200, {foo: 'bar'}) | |
}) | |
}); |
import React, { PropTypes } from 'react' | |
const Todo = ({ onClick, completed, text }) => ( | |
<li | |
onClick={onClick} | |
style={{ | |
textDecoration: completed ? 'line-through' : 'none' | |
}} | |
> | |
{text} |
import React from 'react'; | |
import TestUtils from 'react/lib/ReactTestUtils'; | |
import actions from '../actions' | |
import ConnectedAddTodo from './AddTodo.js' | |
import { Provider } from 'react-redux'; | |
import configureMockStore from 'redux-mock-store'; | |
const store = configureMockStore()({}); | |
describe('AddTodo', () => { | |
let instance, container; |
import Constants from '../path/to/constants'; | |
import Service from '../path/to/service'; | |
const Actions = { | |
toggleSomething: (id) => ({ | |
type: Constants.TOGGLE_SOMETHING, | |
id | |
}), | |
resourceSuccessfullySaved: (data) => ({ | |
type: Constants.RESOURCE_SUCCESSFULLY_SAVED, |