Fix coding standards in specs
This commit is contained in:
parent
342f9c5aa4
commit
79c4aef669
@ -6,7 +6,6 @@ describe 'API playlists' do
|
|||||||
it 'lists playlists' do
|
it 'lists playlists' do
|
||||||
playlist = create :playlist
|
playlist = create :playlist
|
||||||
get api_playlists_path, format: :json
|
get api_playlists_path, format: :json
|
||||||
|
|
||||||
expect(json).to eq(
|
expect(json).to eq(
|
||||||
playlists: [{
|
playlists: [{
|
||||||
id: playlist.id,
|
id: playlist.id,
|
||||||
@ -18,7 +17,6 @@ describe 'API playlists' do
|
|||||||
it 'shows a playlist' do
|
it 'shows a playlist' do
|
||||||
playlist = create :playlist
|
playlist = create :playlist
|
||||||
get api_playlist_path playlist, format: :json
|
get api_playlist_path playlist, format: :json
|
||||||
|
|
||||||
expect(json).to eq(
|
expect(json).to eq(
|
||||||
playlist: {
|
playlist: {
|
||||||
id: playlist.id,
|
id: playlist.id,
|
||||||
@ -30,7 +28,6 @@ describe 'API playlists' do
|
|||||||
it 'creates playlist' do
|
it 'creates playlist' do
|
||||||
playlist = attributes_for :playlist
|
playlist = attributes_for :playlist
|
||||||
post api_playlists_path, format: :json, playlist: playlist
|
post api_playlists_path, format: :json, playlist: playlist
|
||||||
|
|
||||||
expect(json).to match(
|
expect(json).to match(
|
||||||
playlist: {
|
playlist: {
|
||||||
id: an_instance_of(Fixnum),
|
id: an_instance_of(Fixnum),
|
||||||
|
@ -12,7 +12,6 @@ describe 'API sign in' do
|
|||||||
|
|
||||||
it 'signs the user in with valid credentials' do
|
it 'signs the user in with valid credentials' do
|
||||||
do_create
|
do_create
|
||||||
|
|
||||||
expect(json).to eq(user: { id: user.id })
|
expect(json).to eq(user: { id: user.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ describe 'API sign in' do
|
|||||||
it 'rejects authentication' do
|
it 'rejects authentication' do
|
||||||
allow(user).to receive(attr).and_return(user.send(attr) + '_INVALID')
|
allow(user).to receive(attr).and_return(user.send(attr) + '_INVALID')
|
||||||
do_create
|
do_create
|
||||||
|
|
||||||
expect(response).to be_not_found
|
expect(response).to be_not_found
|
||||||
expect(response.body).to be_empty
|
expect(response.body).to be_empty
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,6 @@ describe 'API tracks' do
|
|||||||
track_1 = create :track_with_sound, name: 'Track 1'
|
track_1 = create :track_with_sound, name: 'Track 1'
|
||||||
track_2 = create :track, name: 'Track 2'
|
track_2 = create :track, name: 'Track 2'
|
||||||
get api_tracks_path, format: :json
|
get api_tracks_path, format: :json
|
||||||
|
|
||||||
expect(json).to eq(
|
expect(json).to eq(
|
||||||
tracks: [
|
tracks: [
|
||||||
{
|
{
|
||||||
@ -26,7 +25,6 @@ describe 'API tracks' do
|
|||||||
it 'shows a track' do
|
it 'shows a track' do
|
||||||
track = create :track
|
track = create :track
|
||||||
get api_track_path track, format: :json
|
get api_track_path track, format: :json
|
||||||
|
|
||||||
expect(json).to eq(
|
expect(json).to eq(
|
||||||
track: {
|
track: {
|
||||||
id: track.id,
|
id: track.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user