Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alpaca-tc committed Jun 6, 2024
1 parent 820c440 commit aff1151
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/diver_down/web_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,23 +318,28 @@ def assert_definition_group(definition_group, expected_ids)
metadata.source('a.rb').modules = ['A']
metadata.source('a.rb').memo = 'memo'

metadata.source_alias.update_alias('b.rb', ['a.rb'])

get '/api/sources.json'

expect(last_response.status).to eq(200)
expect(JSON.parse(last_response.body)).to eq({
'sources' => [
{
'source_name' => 'a.rb',
'resolved_alias' => 'b.rb',
'memo' => 'memo',
'modules' => [{ 'module_name' => 'A' }],
},
{
'source_name' => 'b.rb',
'resolved_alias' => nil,
'memo' => '',
'modules' => [],
},
{
'source_name' => 'c.rb',
'resolved_alias' => nil,
'memo' => '',
'modules' => [],
},
Expand Down Expand Up @@ -578,11 +583,13 @@ def assert_definition_group(definition_group, expected_ids)
[
{
'source_name' => 'a.rb',
'resolved_alias' => nil,
'memo' => 'memo',
'modules' => [],
},
{
'source_name' => 'b.rb',
'resolved_alias' => nil,
'memo' => '',
'modules' => [],
},
Expand Down Expand Up @@ -638,6 +645,7 @@ def assert_definition_group(definition_group, expected_ids)
store.set(definition_2)

metadata.source('a.rb').memo = 'memo'
metadata.source_alias.update_alias('b.rb', ['a.rb'])

get '/api/sources/a.rb.json'

Expand All @@ -646,6 +654,7 @@ def assert_definition_group(definition_group, expected_ids)
json = JSON.parse(last_response.body)
expect(json).to eq(
'source_name' => 'a.rb',
'resolved_alias' => 'b.rb',
'memo' => 'memo',
'modules' => [],
'related_definitions' => [
Expand Down

0 comments on commit aff1151

Please sign in to comment.